<awangdev>265. Paint House II_1.java
public int minCostII(int[][] costs) {
        if (costs == null || costs.length == 0) return 0;
        if (costs.length == 1 && costs[0].length == 1) return costs[0][0];

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