comefrom: <doocs>1099.Two Sum Less Than K_1.py
code: def twoSumLessThanK( nums: List[int], k: int) -> int:
      nums.sort()
      low, high = 0, len(nums) - 1
      res = -1
      while low < high:
          val = nums[low] + nums[high]
          if val < k:
              res = max(res, val)
              low += 1
          else:
              high -= 1
      return res
masked: def sample_funcname ( var_0 : List [ int ] , var_1 : int ) -> int :
      var_0.sort ( )
      var_2 , var_3 = 0 , len ( var_0 ) - 1
      var_4 = - 1
      while var_2 < var_3 :
          var_5 = var_0 [ var_2 ] + var_0 [ var_3 ]
          if var_5 < var_1 :
              var_4 = max ( var_4 , var_5 )
              var_2 += 1
          else :
              var_3 -= 1
      return var_4
  