---
title: "Jack Follansbee (@MrPeach) | Hashnode"
description: "Jack Follansbee (@MrPeach) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@MrPeach"
---

@MrPeach

# Jack Follansbee

@MrPeach · Joined July 2022

## Comments

[See above, that's fairly close to what my code does.](https://hashnode.com/posts/how-to-solve-the-staircase-problem-with-javascript-using-memoization/62c8bcbde62bf98e0fb06a4a/comment/62d04bf26b0f8eeb0e0671f3#reply-62db8320cf7a8a6d54f061b7)

Reply · Article · Jul 23, 2022 · [How to Solve the Staircase Problem with JavaScript using Memoization](https://hashnode.com/posts/how-to-solve-the-staircase-problem-with-javascript-using-memoization/62c8bcbde62bf98e0fb06a4a)

[Pardon me for rewriting in Python. My code runs without recursion and at about the same speed. def StairCaseMemo(N): memo = {} def stepsM(N): if N == 0: return 1 elif N<0: return 0 if N in memo.keys(): return memo\[N\] else: memo\[N\] = stepsM(N - 1) + stepsM(N - 2) + stepsM(N - 3); return memo\[N\]; print(stepsM(N)) def StairCaseMine(limit): # initial setup array = {} array\[0\] = 1 array\[1\] = array\[2\] = index = 0 while index < limit: count = array\[index\] array\[index+1\] += count array\[index+2\] += count array\[index+3\] = count index += 1 print(array\[limit\]) Enjoy!](https://hashnode.com/posts/how-to-solve-the-staircase-problem-with-javascript-using-memoization/62c8bcbde62bf98e0fb06a4a/comment/62db7a5dcf7a8a6d54f0605b)

Comment · Article · Jul 23, 2022 · [How to Solve the Staircase Problem with JavaScript using Memoization](https://hashnode.com/posts/how-to-solve-the-staircase-problem-with-javascript-using-memoization/62c8bcbde62bf98e0fb06a4a)
