comefrom: <awangdev>256. Paint House_2.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[n + 1][m]; 
          
          for (int i = 1; i <= n; i++) {
              for (int j = 0; j < m; j++) {
                  dp[i][j] = Integer.MAX_VALUE;
                  for (int k = 0; k < m; k++) {
                      if (j == k) continue; 
                      dp[i][j] = Math.min(dp[i][j], dp[i - 1][k] + costs[i - 1][j]);
                  }
              }
          }
          
          int min = Integer.MAX_VALUE;
          for (int j = 0; j < m; j++) min = Math.min(min, dp[n][j]);
          return min;
      }
masked: public int sample_funcname ( int [ ] [ ] var_0 ) {
    if ( var_0 == null || var_0 . length == 0 ) return 0 ;
    int var_4 = var_0 . length , var_5 = var_0 [ 0 ] . length ;
    int [ ] [ ] var_7 = new int [ var_4 + 1 ] [ var_5 ] ;
    for ( int var_8 = 1 ;
    var_8 <= var_4 ;
    var_8 ++ ) {
      for ( int var_9 = 0 ;
      var_9 < var_5 ;
      var_9 ++ ) {
        var_7 [ var_8 ] [ var_9 ] = Integer . MAX_VALUE ;
        for ( int var_12 = 0 ;
        var_12 < var_5 ;
        var_12 ++ ) {
          if ( var_9 == var_12 ) continue ;
          var_7 [ var_8 ] [ var_9 ] = Math . min ( var_7 [ var_8 ] [ var_9 ] , var_7 [ var_8 - 1 ] [ var_12 ] + var_0 [ var_8 - 1 ] [ var_9 ] ) ;
        }
      }
    }
    int min = Integer . MAX_VALUE ;
    for ( int var_9 = 0 ;
    var_9 < var_5 ;
    var_9 ++ ) min = Math . min ( min , var_7 [ var_4 ] [ var_9 ] ) ;
    return min ;
  }
  