comefrom: <garvit244>42_1.py
code: def trap( height):
      if not height:
          return 0
      
      left, right = 0, len(height) - 1
      leftMax, rightMax = 0, 0
      result = 0
      while left < right:
          if height[left] < height[right]:
              if height[left] > leftMax:
                  leftMax = height[left]
              else:
                  result += (leftMax - height[left])
              left += 1
          else:
              if height[right] > rightMax:
                  rightMax = height[right]
              else:
                  result += (rightMax - height[right])
              right -= 1
      
      return result
masked: def sample_funcname ( var_0 ) :
      if not var_0 :
          return 0
      var_2 , var_5 = 0 , len ( var_0 ) - 1
      var_6 , var_7 = 0 , 0
      var_8 = 0
      while var_2 < var_5 :
          if var_0 [ var_2 ] < var_0 [ var_5 ] :
              if var_0 [ var_2 ] > var_6 :
                  var_6 = var_0 [ var_2 ]
              else :
                  var_8 += ( var_6 - var_0 [ var_2 ] )
              var_2 += 1
          else :
              if var_0 [ var_5 ] > var_7 :
                  var_7 = var_0 [ var_5 ]
              else :
                  var_8 += ( var_7 - var_0 [ var_5 ] )
              var_5 -= 1
      return var_8
  