Skip to content

Instantly share code, notes, and snippets.

@felipekm
Created July 8, 2022 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipekm/ef7b49c80686f03e306d210f2b4b3d54 to your computer and use it in GitHub Desktop.
Save felipekm/ef7b49c80686f03e306d210f2b4b3d54 to your computer and use it in GitHub Desktop.
Given an array of positive integers representing the values of coins in your possession,
write a function that returns the minimum amount of change (the minimum sum of money) that you CANNOT create.
The given coins can have any positive integer value and aren't necessarily
unique (i.e., you can have multiple coins of the same value).
Examples:
```
> {"coins": [5, 7, 1, 1, 2, 3, 22]} -> 20
> {"coins": [1, 1, 1, 1, 1]} -> 6
> {"coins": [1, 5, 1, 1, 1, 10, 15, 20, 100]} -> 55
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment