overdrivemachines / non-constructible-change

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-Constructible Change

Develop a function that takes an array of positive integers representing the values of coins in your possession. The function should determine the minimum amount of change, defined as the smallest sum of money that cannot be created using the given coins. It is possible to have multiple coins of the same value, and the coins can have any positive integer value.

For instance, if the array of coins is [1, 2, 5], the minimum amount of change that cannot be created is 4. In the case of an empty coin array, the minimum amount of change that cannot be created is 1.

Sample Input

coins = [5, 7, 1, 1, 2, 3, 22]

Sample Output

20

About


Languages

Language:Python 100.0%