We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
memo={1:1,2:2,3:4}defr(n):# Write your code hereifn<=0:return0ifninmemo:returnmemo[n]result=r(n-1)+r(n-2)+r(n-3)memo[n]=resultreturnresultdefstepPerms(n):returnr(n)%(10**10+7)
Cookie support is required to access HackerRank
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 →