DEV Community

Discussion on: How to Solve the Staircase Problem with 5 Lines of JavaScript

Collapse
 
christiankozalla profile image
Christian Kozalla

great article! Once I've copied the steps function to the browser console of this tab and played around with it, and reading through your great explanation, I understand what this function represents: a tree diagram of climbing up the stairs, one step after the other.. i can literally see the tree in front of me. Every node represents a step, and from each step, we have to make one of three choices for the next step :D

Collapse
 
apmfree78 profile image
Amit Mehta

Yes! A tree is a brilliant way of thinking about it!