comefrom: <doocs>0084.Largest Rectangle in Histogram_1.py
code: def largestRectangleArea( heights: List[int]) -> int:
      n = len(heights)
      stk = []
      left = [-1] * n
      right = [n] * n
      for i, h in enumerate(heights):
          while stk and heights[stk[-1]] >= h:
              right[stk[-1]] = i
              stk.pop()
          if stk:
              left[i] = stk[-1]
          stk.append(i)
      return max(h * (right[i] - left[i] - 1) for i, h in enumerate(heights))
masked: def sample_funcname ( var_0 : List [ int ] ) -> int :
      var_1 = len ( var_0 )
      var_2 = [ ]
      var_3 = [ - 1 ] * var_1
      var_4 = [ var_1 ] * var_1
      for var_5 , var_6 in enumerate ( var_0 ) :
          while var_2 and var_0 [ var_2 [ - 1 ] ] >= var_6 :
              var_4 [ var_2 [ - 1 ] ] = var_5
              var_2.pop ( )
          if var_2 :
              var_3 [ var_5 ] = var_2 [ - 1 ]
          var_2.append ( var_5 )
      return max ( var_6 * ( var_4 [ var_5 ] - var_3 [ var_5 ] - 1 ) for var_5 , var_6 in enumerate ( var_0 ) )
  