You are viewing a single comment's thread. Return to all comments →
Worked like a charm in Python3! No problem with big numbers too.
dict = {0:0, 1:1, 2:2, 3:4} def steps(n): if n in dict.keys(): return dict.get(n) result = steps(n-3) + steps(n-2) + steps(n-1) dict.update({n: result}) return dict.get(n)
Seems like cookies are disabled on this browser, please enable them to open this website
Recursion: Davis' Staircase
You are viewing a single comment's thread. Return to all comments →
Worked like a charm in Python3! No problem with big numbers too.