comefrom: <awangdev>42. Trapping Rain Water_1.java
code: public int trap(int[] height) {
          if (height == null || height.length == 0) return 0;
          int n = height.length;
          int[] maxLeft = new int[n], maxRight = new int[n];
          maxLeft[0] = height[0];
          maxRight[n - 1] = height[n - 1];
          for (int i = 1; i < n; i++) maxLeft[i] = Math.max(maxLeft[i - 1], height[i]);
          for (int i = n - 2; i >= 0; i--) maxRight[i] = Math.max(maxRight[i + 1], height[i]);
  
          int total = 0;
          for (int i = 0; i < n; i++) {
              int waterDepth = Math.min(maxLeft[i], maxRight[i]);
              total += height[i] < waterDepth ? waterDepth - height[i] : 0;
          }
          return total;
      }
masked: public int sample_funcname ( int [ ] var_0 ) {
    if ( var_0 == null || var_0 . length == 0 ) return 0 ;
    int var_4 = var_0 . length ;
    int [ ] var_5 = new int [ var_4 ] , var_6 = new int [ var_4 ] ;
    var_5 [ 0 ] = var_0 [ 0 ] ;
    var_6 [ var_4 - 1 ] = var_0 [ var_4 - 1 ] ;
    for ( int var_8 = 1 ;
    var_8 < var_4 ;
    var_8 ++ ) var_5 [ var_8 ] = Math . max ( var_5 [ var_8 - 1 ] , var_0 [ var_8 ] ) ;
    for ( int var_8 = var_4 - 2 ;
    var_8 >= 0 ;
    var_8 -- ) var_6 [ var_8 ] = Math . max ( var_6 [ var_8 + 1 ] , var_0 [ var_8 ] ) ;
    int var_12 = 0 ;
    for ( int var_8 = 0 ;
    var_8 < var_4 ;
    var_8 ++ ) {
      int var_14 = Math . min ( var_5 [ var_8 ] , var_6 [ var_8 ] ) ;
      var_12 += var_0 [ var_8 ] < var_14 ? var_14 - var_0 [ var_8 ] : 0 ;
    }
    return var_12 ;
  }
  