Skip to content
Snippets Groups Projects
Commit 06b36980 authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

Added solution to problem 31

parent 67c40e5a
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
def pos(amt, coins):
p = 0
for i, c in enumerate(coins):
if c == amt:
p += 1
elif c < amt:
p += pos(amt - c, coins[i:])
return p
print pos(200, [1, 2, 5, 10, 20, 50, 100, 200])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment