Class Solution
-
- All Implemented Interfaces:
public final class Solution3133 - Minimum Array End.
Medium
You are given two integers
nandx. You have to construct an array of positive integersnumsof sizenwhere for every0 <= i < n - 1,nums[i + 1]is greater thannums[i], and the result of the bitwiseANDoperation between all elements ofnumsisx.Return the minimum possible value of
nums[n - 1].Example 1:
Input: n = 3, x = 4
Output: 6
Explanation:
numscan be[4,5,6]and its last element is 6.Example 2:
Input: n = 2, x = 7
Output: 15
Explanation:
numscan be[7,15]and its last element is 15.Constraints:
<code>1 <= n, x <= 10<sup>8</sup></code>
-
-
Constructor Summary
Constructors Constructor Description Solution()
-