You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Competitive Coding/Dynamic Programming/Coin Change/Coin Change Readme.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,25 @@
1
1
Problem :-
2
+
===
2
3
Given a value N and the values of different denomination,find the number of ways to make changes for N cents,if we have infinite supply of all denominations.
3
4
4
-
Input : Size of an array and all the values in the array and the number of cents.
5
-
6
-
Output : An integer that denotes the number of ways to make change.
7
-
8
-
Language : C++
9
-
10
-
Algorithm Paradigm : Dynamic Programming
11
-
12
-
Time Complexity : O(N*M)
13
-
14
-
Space Complexity : O(N*M)
15
-
5
+
Input:-
6
+
---
7
+
Size of an array and all the values in the array and the number of cents.
8
+
9
+
Output :-
10
+
---
11
+
An integer that denotes the number of ways to make change.
12
+
13
+
Language : **C++**
14
+
---
15
+
Algorithm Paradigm : **Dynamic Programming**
16
+
---
17
+
Time Complexity : **O(N*M)**
18
+
---
19
+
Space Complexity : **O(N*M)**
20
+
---
16
21
Working :-
17
-
22
+
---
18
23
An arr array stores the different currency values.
19
24
Another array temp stores the best values for sub-problems.For eg: temp[3][4] stores the optimal value for the number of ways
20
25
to make change if the number of cents(N) were 4 and we only had arr[0],arr[1] and arr[2] as the different values of currency.
0 commit comments