comefrom: <awangdev>256. Paint House_1.java
code: public int minCost(int[][] costs) {
          int n = costs.length;
          int[][] dp = new int[2][3]; 
          
          for (int i = 1; i <= n; i++) {
              int last = (i - 1) % 2, curr = i % 2; 
              for (int j = 0; j < 3; j++) { 
                  dp[curr][j] = Math.min(dp[last][(j + 1) % 3], dp[last][(j + 2) % 3]) + costs[i-1][j];
              }
          }
          
          return Math.min(Math.min(dp[n%2][0], dp[n%2][1]), dp[n%2][2]);
      }
masked: public int sample_funcname ( int [ ] [ ] var_0 ) {
    int var_1 = var_0 . length ;
    int [ ] [ ] var_2 = new int [ 2 ] [ 3 ] ;
    for ( int var_3 = 1 ;
    var_3 <= var_1 ;
    var_3 ++ ) {
      int var_4 = ( var_3 - 1 ) % 2 , var_5 = var_3 % 2 ;
      for ( int var_6 = 0 ;
      var_6 < 3 ;
      var_6 ++ ) {
        var_2 [ var_5 ] [ var_6 ] = Math . min ( var_2 [ var_4 ] [ ( var_6 + 1 ) % 3 ] , var_2 [ var_4 ] [ ( var_6 + 2 ) % 3 ] ) + var_0 [ var_3 - 1 ] [ var_6 ] ;
      }
    }
    return Math . min ( Math . min ( var_2 [ var_1 % 2 ] [ 0 ] , var_2 [ var_1 % 2 ] [ 1 ] ) , var_2 [ var_1 % 2 ] [ 2 ] ) ;
  }
  