recursion-tree-visualizer
recursion-tree-visualizer copied to clipboard
Run code successfully on local machine, But get an error online
Here is my code:
coins = [25,20,10,5,1]
def fn(i, m):
if 0 == m:
return 0
if len(coins) == i:
return 0x3f3f3f3f
ans = 0x3f3f3f3f
for k in range(m // coins[i] + 1):
ans = min(ans, fn(i+1,m-coins[i]*k) + k)
return ans
print(fn(0,40))
It can run in jupyterlab

I copy this code to https://recursion.vercel.app/, but it get an error: Your code outputs the following TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

I don't know why it can not run online. I hope you can help me. Thanks!😊