File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1
1
import sys
2
2
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
3
9
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
4
25
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
+ """
5
43
def find_minimum_change (denominations : list [int ], value : int ) -> list [int ]:
6
44
"""
7
45
Find the minimum change from the given denominations and value.
You can’t perform that action at this time.
0 commit comments