Interview Question- Boxes challenge - dynamic

I have written this code to solve for this challenge, although , it does not work well for large numbers. If I make a computations object should the key be the element at 0th index and its result be its computation? am I thinking about this correctly? I only care about the final computation.

The second function is just a recursive version of the first. The instructions are at the bottom of the file

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.