|
35 | 35 | 100
|
36 | 36 | 500
|
37 | 37 | 1000
|
38 |
| -Enter the change you want to make in Indian Currency: 456 |
| 38 | +Enter the change you want to make: 456 |
39 | 39 | Following is minimal change for 456 :
|
40 | 40 | 100 100 100 100 5 5 5 5 5 5 5 5 5 5 5 1
|
41 | 41 | """
|
42 | 42 |
|
43 | 43 |
|
44 | 44 | def find_minimum_change(denominations: list, value: int) -> list:
|
45 |
| - |
| 45 | + """ |
| 46 | + Find the minimum change from the given denominations and value |
| 47 | + >>> find_minimum_change([1, 5, 10, 20, 50, 100, 200, 500, 1000,2000], 18745) |
| 48 | + [2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 500, 200, 20, 20, 5] |
| 49 | + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 987) |
| 50 | + [500, 100, 100, 100, 100, 50, 20, 10, 5, 2] |
| 51 | + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], 0) |
| 52 | + [] |
| 53 | + >>> find_minimum_change([1, 2, 5, 10, 20, 50, 100, 500, 2000], -98) |
| 54 | + [] |
| 55 | + >>> find_minimum_change([1, 5, 100, 500, 1000], 456) |
| 56 | + [100, 100, 100, 100, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1] |
| 57 | + """ |
46 | 58 | total_value = int(value)
|
47 | 59 |
|
48 | 60 | # Initialize Result
|
|
0 commit comments