input: def min_last_element(n: int, x: int) -> int:
      """
      Given two integers n and x, construct an array of positive integers nums of size n where for every 0 <= i < n - 1, nums[i + 1] > nums[i], and the bitwise AND of all elements in nums equals x.
  
      Return the smallest 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 n == 1:
          return x
  
      # Start with a base progressive array
      nums = []
      nums.append(1)
      
      for i in range(1, n - 1):
          nums.append(nums[-1] + 1)
      
      # Now we need to find the smallest possible nums[n-1] such that it satisfies the condition
      last_element = x | ((1 << 30) - 1)
      
      # Ensure that each nums[i] < nums[i + 1]
      while last_element <= nums[-1]:
          last_element += 1
      
      return last_element