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
4 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
Steven Crowder
3 hours ago🔴 Social Security Scandal: How Elites Use Illegals to Game The American System
37,984 watching -
1:12:06
The Rubin Report
2 hours agoBill Maher Makes Gavin Newsom Look Dumb with Simple Questions
27.9K12 -
LIVE
Benny Johnson
1 hour ago🚨 Trump CONFIRMS He Is Running For President AGAIN | Libs FREAK as Experts Say Third Term POSSIBLE
8,219 watching -
1:01:04
VINCE
3 hours agoWisconsin Decides The Future Of The World | Episode 11 - 03/31/25
250K163 -
LIVE
Grant Stinchfield
1 hour agoTexas AG To Investigate Muslim Centric Communities and The Quest to Take Over America
220 watching -
33:56
Rethinking the Dollar
1 hour agoThe Bigger Issue Is War, Not A Silver Squeeze | Morning Check-In
14.9K5 -
LIVE
Flyover Conservatives
11 hours agoNathan French Drops Prophetic Bombs About Trump, Revival & America’s Future | FOC Show
564 watching -
LIVE
The Shannon Joy Show
1 hour ago🔥🔥Nothing Is Changing - In Fact It’s Getting Worse. But This Weekend’s #SummitForTruth In New York Gave Us Reason For HOPE And A Path To Liberty & Normalcy.🔥🔥
244 watching -
LIVE
LFA TV
15 hours agoLFA ALL DAY LIVE STEAM! 3/31/25
2,524 watching -
59:21
BonginoReport
6 hours agoKansas Capitol: Satanists Violently Attack Christians - Early Edition w/Evita (Ep.171) - 03/31/2025
177K200