Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
I copy and pasted your solution in for "All Paths for a Sum" and the code below ...

dg

Jul 13, 2022

I copy and pasted your solution in for "All Paths for a Sum" and the code below does not seem to work. It just outputs two empty arrays. Even using the Dequeue lib (which, seeing as I generally can't install libs during an interview, it feels odd to see these peppered in), it does not work. Anyone else seen this?

4

0

Comments
Comments
B
Bitaseme Mboe3 years ago

Yes. I am also getting the issue. It would be helpful if the team could resolve it. Especially since we are paying for this material. I at least expect the solutions to be correct.

Design Gurus
Design Gurus3 years ago

What changes did you make to the solution? Can you share your solution? Please make a paste : https://pastebin.com/

B
Becca 3 years ago

I'm seeing the same thing, https://pastebin.com/gBCFmfwn

Design Gurus
Design Gurus3 years ago

Becca Can you paste the complete solution? The code in you paste is giving compile errors.

D
Delphine Sintamour3 years ago

For the JS solution, when adding to the allPaths array, you must push a new array. I did not use dequeue since you can just use an array. But when pushing to the allPaths array i used the spread operator enclosed in brackets to create a new array. [...currentPath]

On this page