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

0% completed

Vote For New Content
How is the current implementation checking sum of every possible sub-paths? The ...

hj3yoo

Mar 3, 2022

How is the current implementation checking sum of every possible sub-paths? The for loop just goes through the current traversal and adds starting from the root to the current node.

Shouldn't there be either a 2D for-loop or a sliding window?

0

0

Comments
Comments
H
hj3yoo 4 years ago

Nvm, didn't realize that this calculation is done at every recursion, so it does go through all permutations.

On this page