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
9 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 Rubin Report
39 minutes agoJimmy Kimmel Humiliated as NY Post Exposes His Dark Reaction to Being Canceled
2,226 watching -
LIVE
LFA TV
12 hours agoKIMMEL GONE | ANTIFA LABELED TERRORISTS! - THURSDAY 9/18/25
4,296 watching -
1:41:51
Dear America
2 hours agoJimmy Kimmel’s Show Gets CANCELLED Because Of His Comments On Charlie!! + Kash EXPOSES CIA!!
144K55 -
LIVE
Benny Johnson
1 hour agoHow We Got Jimmy Kimmel Ripped Off-Air, Why The Right Must Fight | Trump Press Conference LIVE Now
5,985 watching -
LIVE
The Big Migâ„¢
1 hour agoThe Lefts Nuclear Meltdown, Cancel Culture Cancels Jimmy Kimmel
6,033 watching -
LIVE
Chad Prather
49 minutes agoJimmy Kimmel Is FIRED After Horrific Charlie Kirk Comments + Trump Designates ANTIFA As Terrorists!
432 watching -
55:01
The White House
2 hours agoPress Conference with the Prime Minister of the United Kingdom of Great Britain and Northern Ireland
1.25K3 -
Barry Cunningham
58 minutes agoBREAKING NEWS: PRESIDENT TRUMP PARTICIPATES IN PRESS CONFERENCE IN ENGLAND
2 -
LIVE
Badlands Media
8 hours agoBadlands Daily: September 18, 2025
3,816 watching -
LIVE
JuicyJohns
2 hours ago $0.61 earned🟢#1 REBIRTH PLAYER 10.2+ KD🟢
55 watching