Solving Path Sum
Jul 5, 2024 · 5 min read · 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...
Join discussion












