Find the fewest coins needed to make a given amount from unlimited coin denominations.
Constraints
Example
>>> coin_change([1,2,5], 11) 3 # 5+5+1 >>> coin_change([2], 3) -1 >>> coin_change([1], 0) 0 >>> coin_change([2,5,10,1], 27) 4 # 10+10+5+2
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints