comefrom: <doocs>0302.Smallest Rectangle Enclosing Black Pixels_1.py
code: def minArea( image: List[List[str]], x: int, y: int) -> int:
      m, n = len(image), len(image[0])
      left, right = 0, x
      while left < right:
          mid = (left + right) >> 1
          c = 0
          while c < n and image[mid][c] == '0':
              c += 1
          if c < n:
              right = mid
          else:
              left = mid + 1
      u = left
      left, right = x, m - 1
      while left < right:
          mid = (left + right + 1) >> 1
          c = 0
          while c < n and image[mid][c] == '0':
              c += 1
          if c < n:
              left = mid
          else:
              right = mid - 1
      d = left
      left, right = 0, y
      while left < right:
          mid = (left + right) >> 1
          r = 0
          while r < m and image[r][mid] == '0':
              r += 1
          if r < m:
              right = mid
          else:
              left = mid + 1
      l = left
      left, right = y, n - 1
      while left < right:
          mid = (left + right + 1) >> 1
          r = 0
          while r < m and image[r][mid] == '0':
              r += 1
          if r < m:
              left = mid
          else:
              right = mid - 1
      r = left
      return (d - u + 1) * (r - l + 1)
masked: def sample_funcname ( var_0 : List [ List [ str ] ] , var_3 : int , var_5 : int ) -> int :
      var_7 , var_9 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_10 , var_11 = 0 , var_3
      while var_10 < var_11 :
          var_13 = ( var_10 + var_11 ) >> 1
          var_14 = 0
          while var_14 < var_9 and var_0 [ var_13 ] [ var_14 ] == '0' :
              var_14 += 1
          if var_14 < var_9 :
              var_11 = var_13
          else :
              var_10 = var_13 + 1
      var_16 = var_10
      var_10 , var_11 = var_3 , var_7 - 1
      while var_10 < var_11 :
          var_13 = ( var_10 + var_11 + 1 ) >> 1
          var_14 = 0
          while var_14 < var_9 and var_0 [ var_13 ] [ var_14 ] == '0' :
              var_14 += 1
          if var_14 < var_9 :
              var_10 = var_13
          else :
              var_11 = var_13 - 1
      var_17 = var_10
      var_10 , var_11 = 0 , var_5
      while var_10 < var_11 :
          var_13 = ( var_10 + var_11 ) >> 1
          var_18 = 0
          while var_18 < var_7 and var_0 [ var_18 ] [ var_13 ] == '0' :
              var_18 += 1
          if var_18 < var_7 :
              var_11 = var_13
          else :
              var_10 = var_13 + 1
      var_19 = var_10
      var_10 , var_11 = var_5 , var_9 - 1
      while var_10 < var_11 :
          var_13 = ( var_10 + var_11 + 1 ) >> 1
          var_18 = 0
          while var_18 < var_7 and var_0 [ var_18 ] [ var_13 ] == '0' :
              var_18 += 1
          if var_18 < var_7 :
              var_10 = var_13
          else :
              var_11 = var_13 - 1
      var_18 = var_10
      return ( var_17 - var_16 + 1 ) * ( var_18 - var_19 + 1 )
  