Skip to content

Commit 0bbf0ea

Browse files
authored
Update minimum_coin_change.py
Add some input and output examples on top
1 parent 8112c05 commit 0bbf0ea

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

greedy_methods/minimum_coin_change.py

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

0 commit comments

Comments
 (0)