public static int coinChange(int[] coins, int amount) {
        if (amount==0){
            return 0;
        }
        if (coins == null || coins.length <1){
            return -1;
        }
        int [] noc = new int[amount+1];
        noc[0]=0;

        for (int i=1; i<=amount; i++){
            noc[i] = Integer.MAX_VALUE;
            for (int j=0; j<coins.length; j++){
                if (i-coins[j]>=0 && noc[i-coins[j]] != Integer.MAX_VALUE && noc[i] > noc[i-coins[j]] +1){
                    noc[i] = noc[i-coins[j]] +1;
                }
            }
            System.out.println(i + ": " + Arrays.toString(noc));
            System.out.println("----------------------\n");
        }

        System.out.println("the noc[amount]: "+noc[amount]);
        return noc[amount] == Integer.MAX_VALUE?-1:noc[amount];

    }