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.
This still calculates from i=4 to n each time. Could make this linear by making "ways" global to store previously found values and only running recursion if you don't have ways[n] yet.
Recursion: Davis' Staircase
You are viewing a single comment's thread. Return to all comments →
This still calculates from i=4 to n each time. Could make this linear by making "ways" global to store previously found values and only running recursion if you don't have ways[n] yet.