Solving Path Sum
To see the question, click here.
Naive Approach
The idea is to maintain two stacks nodeStack and sumStack . Until nodeStack is empty; if it's a leaf node and the current sum equals 0, we found a path. Process the right child by pushing it onto the no...
vineethchivukula.hashnode.dev5 min read