comefrom: <gouthampradhan>dynamic_programming_PaintHouseII_1.java
code: public int minCostII(int[][] costs) {
      if (costs.length == 0) return 0;
      int[][] lMin = new int[costs.length][costs[0].length];
      int[][] rMin = new int[costs.length][costs[0].length];
      for (int i = costs.length - 2; i >= 0; i--) {
        int min = Integer.MAX_VALUE;
        for (int j = 0; j < costs[0].length; j++) {
          lMin[i + 1][j] = min;
          min = Math.min(min, costs[i + 1][j]);
        }
        min = Integer.MAX_VALUE;
        for (int j = costs[0].length - 1; j >= 0; j--) {
          rMin[i + 1][j] = min;
          min = Math.min(min, costs[i + 1][j]);
        }
        for (int j = 0; j < costs[0].length; j++) {
          if (j == 0) {
            costs[i][j] = costs[i][j] + rMin[i + 1][j];
          } else if (j == costs[0].length - 1) {
            costs[i][j] = costs[i][j] + lMin[i + 1][j];
          } else {
            costs[i][j] = costs[i][j] + Math.min(lMin[i + 1][j], rMin[i + 1][j]);
          }
        }
      }
      int min = Integer.MAX_VALUE;
      for (int i = 0; i < costs[0].length; i++) {
        min = Math.min(min, costs[0][i]);
      }
      return min;
    }
masked: public int sample_funcname ( int [ ] [ ] var_0 ) {
    if ( var_0 . length == 0 ) return 0 ;
    int [ ] [ ] var_1 = new int [ var_0 . length ] [ var_0 [ 0 ] . length ] ;
    int [ ] [ ] var_2 = new int [ var_0 . length ] [ var_0 [ 0 ] . length ] ;
    for ( int var_3 = var_0 . length - 2 ;
    var_3 >= 0 ;
    var_3 -- ) {
      int min = Integer . MAX_VALUE ;
      for ( int var_4 = 0 ;
      var_4 < var_0 [ 0 ] . length ;
      var_4 ++ ) {
        var_1 [ var_3 + 1 ] [ var_4 ] = min ;
        min = Math . min ( min , var_0 [ var_3 + 1 ] [ var_4 ] ) ;
      }
      min = Integer . MAX_VALUE ;
      for ( int var_4 = var_0 [ 0 ] . length - 1 ;
      var_4 >= 0 ;
      var_4 -- ) {
        var_2 [ var_3 + 1 ] [ var_4 ] = min ;
        min = Math . min ( min , var_0 [ var_3 + 1 ] [ var_4 ] ) ;
      }
      for ( int var_4 = 0 ;
      var_4 < var_0 [ 0 ] . length ;
      var_4 ++ ) {
        if ( var_4 == 0 ) {
          var_0 [ var_3 ] [ var_4 ] = var_0 [ var_3 ] [ var_4 ] + var_2 [ var_3 + 1 ] [ var_4 ] ;
        }
        else if ( var_4 == var_0 [ 0 ] . length - 1 ) {
          var_0 [ var_3 ] [ var_4 ] = var_0 [ var_3 ] [ var_4 ] + var_1 [ var_3 + 1 ] [ var_4 ] ;
        }
        else {
          var_0 [ var_3 ] [ var_4 ] = var_0 [ var_3 ] [ var_4 ] + Math . min ( var_1 [ var_3 + 1 ] [ var_4 ] , var_2 [ var_3 + 1 ] [ var_4 ] ) ;
        }
      }
    }
    int min = Integer . MAX_VALUE ;
    for ( int var_3 = 0 ;
    var_3 < var_0 [ 0 ] . length ;
    var_3 ++ ) {
      min = Math . min ( min , var_0 [ 0 ] [ var_3 ] ) ;
    }
    return min ;
  }
  