Skip to content

Commit 0473253

Browse files
committed
Update minimum_coin_change.py
2 parents f575807 + 0bbf0ea commit 0473253

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

greedy_methods/minimum_coin_change.py

+43
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
import sys
22
from doctest import testmod
3+
<<<<<<< HEAD
4+
=======
5+
"""
6+
Test cases:
7+
Do you want to enter your denominations ? (Y/N) :N
8+
Enter the change you want to make in Indian Currency: 987
9+
Following is minimal change for 987 :
10+
500 100 100 100 100 50 20 10 5 2
11+
12+
Do you want to enter your denominations ? (Y/N) :Y
13+
Enter number of denomination:10
14+
1
15+
5
16+
10
17+
20
18+
50
19+
100
20+
200
21+
500
22+
1000
23+
2000
24+
Enter the change you want to make: 18745
25+
Following is minimal change for 18745 :
26+
2000 2000 2000 2000 2000 2000 2000 2000 2000 500 200 20 20 5
27+
28+
Do you want to enter your denominations ? (Y/N) :N
29+
Enter the change you want to make: 0
30+
The total value cannot be zero or negative.
31+
Do you want to enter your denominations ? (Y/N) :N
32+
Enter the change you want to make: -98
33+
The total value cannot be zero or negative.
34+
Do you want to enter your denominations ? (Y/N) :Y
35+
Enter number of denomination:5
36+
1
37+
5
38+
100
39+
500
40+
1000
41+
Enter the change you want to make: 456
42+
Following is minimal change for 456 :
43+
100 100 100 100 5 5 5 5 5 5 5 5 5 5 5 1
44+
"""
45+
>>>>>>> 0bbf0ea76e478706b1fa9ea377465c52f5195c6f
346
def find_minimum_change(denominations: list[int], value: int) -> list[int]:
447
"""
548
Find the minimum change from the given denominations and value.

0 commit comments

Comments
 (0)