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_1 : int , var_2 : int ) -> int :
      var_3 , var_4 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_5 , var_6 = 0 , var_1
      while var_5 < var_6 :
          var_7 = ( var_5 + var_6 ) >> 1
          var_8 = 0
          while var_8 < var_4 and var_0 [ var_7 ] [ var_8 ] == '0' :
              var_8 += 1
          if var_8 < var_4 :
              var_6 = var_7
          else :
              var_5 = var_7 + 1
      var_9 = var_5
      var_5 , var_6 = var_1 , var_3 - 1
      while var_5 < var_6 :
          var_7 = ( var_5 + var_6 + 1 ) >> 1
          var_8 = 0
          while var_8 < var_4 and var_0 [ var_7 ] [ var_8 ] == '0' :
              var_8 += 1
          if var_8 < var_4 :
              var_5 = var_7
          else :
              var_6 = var_7 - 1
      var_10 = var_5
      var_5 , var_6 = 0 , var_2
      while var_5 < var_6 :
          var_7 = ( var_5 + var_6 ) >> 1
          var_11 = 0
          while var_11 < var_3 and var_0 [ var_11 ] [ var_7 ] == '0' :
              var_11 += 1
          if var_11 < var_3 :
              var_6 = var_7
          else :
              var_5 = var_7 + 1
      var_12 = var_5
      var_5 , var_6 = var_2 , var_4 - 1
      while var_5 < var_6 :
          var_7 = ( var_5 + var_6 + 1 ) >> 1
          var_11 = 0
          while var_11 < var_3 and var_0 [ var_11 ] [ var_7 ] == '0' :
              var_11 += 1
          if var_11 < var_3 :
              var_5 = var_7
          else :
              var_6 = var_7 - 1
      var_11 = var_5
      return ( var_10 - var_9 + 1 ) * ( var_11 - var_12 + 1 )
  