Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.

3133. Minimum Array End
8 months ago
3
You are given two integers n and x. You have to construct an array of positive integers nums of size n where for every 0 <= i < n - 1, nums[i + 1] is greater than nums[i], and the result of the bitwise AND operation between all elements of nums is x.
Return the minimum possible value of nums[n - 1].
Example 1:
Input: n = 3, x = 4
Output: 6
Explanation:
nums can be [4,5,6] and its last element is 6.
Example 2:
Input: n = 2, x = 7
Output: 15
Explanation:
nums can be [7,15] and its last element is 15.
Constraints:
1 <= n, x <= 108
#define ll long long
class Solution {
public:
long long minEnd(int n, int x) {
ll result=x;
while(--n){
result = (result+1) | x;
}
return result;
}
};
Loading comments...
-
LIVE
The Jimmy Dore Show
33 minutes agoTrump Administration Sends Accused Pedo BACK TO ISRAEL! Ukrainians Now OVERWHELMINGLY Oppose War!
4,280 watching -
DVR
TheCrucible
2 hours agoThe Extravaganza! Ep. 24 (8/20/25)
14.3K1 -
1:18:42
Kim Iversen
2 hours agoUFO Base Area 51 Catches Fire… Is It a Massive Cover-Up?!
5.04K24 -
1:51:18
Redacted News
2 hours ago"There will be consequences!!!" Trump issues big threat to Putin ahead of peace summit | Redacted
66.6K41 -
53:14
Candace Show Podcast
2 hours agoThe MOST MORAL Blackmail In The World | Candace EP 231
18.8K66 -
1:11:28
vivafrei
4 hours agoMatt Taibbi Getting "Westfalled"? Kathy Hochul Fighting for Illegals! Mamdani Minority Report & MORE
70K28 -
2:03:39
Pop Culture Crisis
4 hours agoWTF Happened to Miley Cyrus? HARRY POTTER Set Images, Sydney Sweeney Hater EXPOSED | Ep. 901
18.4K18 -
10:17
MattMorseTV
4 hours ago $5.37 earnedTrump's DOJ just DROPPED a NUKE.
23.8K31 -
11:07
Politibrawl
12 days agoRepublican rising star DESTROYS theatrical Democrat in front of the entire world
66.7K30 -
StoneMountain64
5 hours agoOnly game with BETTER desctruction than Battlefield?
45.7K