Skip to content

Commit da9a4f6

Browse files
committed
Coin change
1 parent dccaefc commit da9a4f6

File tree

1 file changed

+0
-16
lines changed
  • datastructure-algorithm-java-examples/src/main/java/com/hellokoding/algorithm

1 file changed

+0
-16
lines changed

datastructure-algorithm-java-examples/src/main/java/com/hellokoding/algorithm/DP_CoinChange.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,5 @@ static int countWays(int[] coins, int targetCoinChange) {
2020

2121
public static void main(String[] args) {
2222
System.out.println(countWays(new int[]{2, 3, 1}, 4));
23-
24-
/*
25-
* w[0] = 1
26-
* i=0, j=2, w[2] = 0 + w[2-2] = 0 + w[0] = 1
27-
* w[3] = w[3] + w[3-2] = w[3] + w[1] = 0 + 0 = 0
28-
* w[4] = w[4] + w[4-2] = 0 + w[2] = 1
29-
*
30-
* i=1, j=3, w[3] = w[3] + w[3-3] = 1
31-
* w[4] = w[4] + w[1] = 1
32-
*
33-
* i=2, j=1, w[1] = w[1] + w[0] = 1
34-
* j=2 w[2] = w[2] + w[1] = 2
35-
* j=3 w[3] = w[3] + w[2] = 3
36-
* j=4 w[4] = w[4] + w[3] = 4
37-
*
38-
* */
3923
}
4024
}

0 commit comments

Comments
 (0)