<gouthampradhan>two_pointers_TrappingRainWater_1.java
private int trap(int[] height) {
    if (height.length == 0) return 0;
    int[] left = new int[height.length];
    int[] right = new int[height.length];
    int max = 0;
    left[0] = 0;
    right[height.length - 1] = 0;
    int total = 0;
    for (int i = 1, l = height.length; i < l; i++) {
      left[i] = Math.max(max, height[i - 1]);
      max = left[i];
    }
    max = 0;
    for (int i = height.length - 2; i >= 0; i--) {
      right[i] = Math.max(max, height[i + 1]);
      max = right[i];
    }
    for (int i = 0, l = height.length; i < l; i++) {
      int min = Math.min(left[i], right[i]);
      if (min > height[i]) {
        total += (min - height[i]);
      }
    }
    return total;
  }
private int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 . length == 0 ) return 0 ;
  int [ ] var_3 = new int [ var_0 . length ] ;
  int [ ] var_4 = new int [ var_0 . length ] ;
  int max = 0 ;
  var_3 [ 0 ] = 0 ;
  var_4 [ var_0 . length - 1 ] = 0 ;
  int var_7 = 0 ;
  for ( int var_8 = 1 , var_9 = var_0 . length ;
  var_8 < var_9 ;
  var_8 ++ ) {
    var_3 [ var_8 ] = Math . max ( max , var_0 [ var_8 - 1 ] ) ;
    max = var_3 [ var_8 ] ;
  }
  max = 0 ;
  for ( int var_8 = var_0 . length - 2 ;
  var_8 >= 0 ;
  var_8 -- ) {
    var_4 [ var_8 ] = Math . max ( max , var_0 [ var_8 + 1 ] ) ;
    max = var_4 [ var_8 ] ;
  }
  for ( int var_8 = 0 , var_9 = var_0 . length ;
  var_8 < var_9 ;
  var_8 ++ ) {
    int min = Math . min ( var_3 [ var_8 ] , var_4 [ var_8 ] ) ;
    if ( min > var_0 [ var_8 ] ) {
      var_7 += ( min - var_0 [ var_8 ] ) ;
    }
  }
  return var_7 ;
}
