Mark As Completed Discussion

When we have 3 houses it becomes a little less intuitive and this is where the dynamic programming comes in. Particularly the bottom up(iterative) process. If we are searching for the nth answer, we can solve a smaller subproblem for the ith answer to solve for n.

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment