comefrom: <awangdev>256. Paint House_3.java
code: public int minCost(int[][] costs) {
          if (costs == null || costs.length == 0) return 0;
          int n = costs.length, m = costs[0].length;
          int[][] dp = new int[2][m]; 
          
          for (int i = 1; i <= n; i++) {
              int curr = i % 2, last = (i - 1) % 2;
              for (int j = 0; j < m; j++) {
                  dp[curr][j] = Integer.MAX_VALUE;
                  for (int k = 0; k < m; k++) {
                      if (j == k) continue; 
                      dp[curr][j] = Math.min(dp[curr][j], dp[last][k] + costs[i - 1][j]);
                  }
              }
          }
          
          int min = Integer.MAX_VALUE;
          for (int j = 0; j < m; j++) min = Math.min(min, dp[n%2][j]);
          return min;
      }
masked: public int sample_funcname ( int [ ] [ ] var_0 ) {
    if ( var_0 == null || var_0 . length == 0 ) return 0 ;
    int var_1 = var_0 . length , var_2 = var_0 [ 0 ] . length ;
    int [ ] [ ] var_3 = new int [ 2 ] [ var_2 ] ;
    for ( int var_4 = 1 ;
    var_4 <= var_1 ;
    var_4 ++ ) {
      int var_5 = var_4 % 2 , var_6 = ( var_4 - 1 ) % 2 ;
      for ( int var_7 = 0 ;
      var_7 < var_2 ;
      var_7 ++ ) {
        var_3 [ var_5 ] [ var_7 ] = Integer . MAX_VALUE ;
        for ( int var_8 = 0 ;
        var_8 < var_2 ;
        var_8 ++ ) {
          if ( var_7 == var_8 ) continue ;
          var_3 [ var_5 ] [ var_7 ] = Math . min ( var_3 [ var_5 ] [ var_7 ] , var_3 [ var_6 ] [ var_8 ] + var_0 [ var_4 - 1 ] [ var_7 ] ) ;
        }
      }
    }
    int min = Integer . MAX_VALUE ;
    for ( int var_7 = 0 ;
    var_7 < var_2 ;
    var_7 ++ ) min = Math . min ( min , var_3 [ var_1 % 2 ] [ var_7 ] ) ;
    return min ;
  }
  