<awangdev>322. Coin Change_1.java
public int coinChange(int[] coins, int amount) {
        int[] dp = new int[amount + 1];
        dp[0] = 0;
        for (int i = 1; i <= amount; i++) {
            dp[i] = Integer.MAX_VALUE;
            for (int coin : coins) {
                if (coin > i || dp[i - coin] == Integer.MAX_VALUE) continue; 
                dp[i] = Math.min(dp[i], dp[i - coin] + 1);
            }
        }
        return dp[amount] == Integer.MAX_VALUE ? -1 : dp[amount];
    }
public int sample_funcname ( int [ ] var_0 , int var_1 ) {
  int [ ] var_3 = new int [ var_1 + 1 ] ;
  var_3 [ 0 ] = 0 ;
  for ( int var_5 = 1 ;
  var_5 <= var_1 ;
  var_5 ++ ) {
    var_3 [ var_5 ] = Integer . MAX_VALUE ;
    for ( int var_8 : var_0 ) {
      if ( var_8 > var_5 || var_3 [ var_5 - var_8 ] == Integer . MAX_VALUE ) continue ;
      var_3 [ var_5 ] = Math . min ( var_3 [ var_5 ] , var_3 [ var_5 - var_8 ] + 1 ) ;
    }
  }
  return var_3 [ var_1 ] == Integer . MAX_VALUE ? - 1 : var_3 [ var_1 ] ;
}
