Pattern Recognition Drill
Easy Advanced Trees
The Problem
Is there a root-to-leaf path that sums to a target?
What approach would you use?
Think about it before scrolling down.
Recurse with target - node.val. At leaf: return target == node.val. O(n).
Common Trap
Must check at leaf nodes, not at null nodes. A leaf has no children.