Commit 06b36980 authored by Taddeus Kroes's avatar Taddeus Kroes

Added solution to problem 31

parent 67c40e5a
#!/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])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment