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
11 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...
-
1:31:56
Michael Franzese
16 hours agoWill NBA do anything about their Gambling Problems?
97.5K19 -
57:26
X22 Report
5 hours agoMr & Mrs X - The Food Industry Is Trying To Pull A Fast One On RFK Jr (MAHA), This Will Fail - EP 14
70.2K40 -
2:01:08
LFA TV
1 day agoTHE RUMBLE RUNDOWN LIVE @9AM EST
129K11 -
1:28:14
On Call with Dr. Mary Talley Bowden
3 hours agoI came for my wife.
9.33K5 -
1:06:36
Wendy Bell Radio
8 hours agoPet Talk With The Pet Doc
44.4K24 -
30:58
SouthernbelleReacts
2 days ago $5.58 earnedWe Didn’t Expect That Ending… ‘Welcome to Derry’ S1 E1 Reaction
24.4K8 -
13:51
True Crime | Unsolved Cases | Mysterious Stories
5 days ago $14.14 earned7 Real Life Heroes Caught on Camera (Remastered Audio)
40.7K9 -
LIVE
Total Horse Channel
14 hours ago2025 IRCHA Derby & Horse Show - November 1st
144 watching -
4:19
PistonPop-TV
6 days ago $5.78 earnedThe 4E-FTE: Toyota’s Smallest Turbo Monster
36.6K -
43:07
WanderingWithWine
6 days ago $3.20 earned5 Dreamy Italian Houses You Can Own Now! Homes for Sale in Italy
27.5K9