input: def min_last_element(n: int, x: int) -> int:
      """
      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].
  
      Examples:
      >>> n = 3, x = 4
      6
      >>> n = 2, x = 7
      15
  
      Constraints:
      1 <= n, x <= 10^8
      """
  
output: 
      if x == 0:
          return 0
      if n == 1:
          return x
      max_bit = 1
      while max_bit <= x:
          max_bit <<= 1
      max_bit -= 1
      if n == 2:
          return max_bit
      if n > max_bit.bit_length():
          return -1
      return max_bit
  