comefrom: <doocs>0658.Find K Closest Elements_1.py
code: def findClosestElements( arr: List[int], k: int, x: int) -> List[int]:
      left, right = 0, len(arr) - k
      while left < right:
          mid = (left + right) >> 1
          if x - arr[mid] <= arr[mid + k] - x:
              right = mid
          else:
              left = mid + 1
      return arr[left : left + k]
masked: def sample_funcname ( var_0 : List [ int ] , var_1 : int , var_2 : int ) -> List [ int ] :
      var_3 , var_4 = 0 , len ( var_0 ) - var_1
      while var_3 < var_4 :
          var_5 = ( var_3 + var_4 ) >> 1
          if var_2 - var_0 [ var_5 ] <= var_0 [ var_5 + var_1 ] - var_2 :
              var_4 = var_5
          else :
              var_3 = var_5 + 1
      return var_0 [ var_3 : var_3 + var_1 ]
  