You are viewing a single comment's thread. Return to all comments →
A Python solution using functools.cache
from functools import cache @cache def stepPerms(n): if n == 0: return 1 elif n == 1: return 1 elif n == 2: return 2 else: return stepPerms(n-3) + stepPerms(n-2) + stepPerms(n-1)
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 →
A Python solution using functools.cache