comefrom: <doocs>1539.Kth Missing Positive Number_1.py
code: def findKthPositive( arr: List[int], k: int) -> int:
      if arr[0] > k:
          return k
      left, right = 0, len(arr)
      while left < right:
          mid = (left + right) >> 1
          if arr[mid] - mid - 1 >= k:
              right = mid
          else:
              left = mid + 1
      return arr[left - 1] + k - (arr[left - 1] - (left - 1) - 1)
masked: def sample_funcname ( var_0 : List [ int ] , var_3 : int ) -> int :
      if var_0 [ 0 ] > var_3 :
          return var_3
      var_5 , var_7 = 0 , len ( var_0 )
      while var_5 < var_7 :
          var_9 = ( var_5 + var_7 ) >> 1
          if var_0 [ var_9 ] - var_9 - 1 >= var_3 :
              var_7 = var_9
          else :
              var_5 = var_9 + 1
      return var_0 [ var_5 - 1 ] + var_3 - ( var_0 [ var_5 - 1 ] - ( var_5 - 1 ) - 1 )
  