Tree
112. Path Sum
Subtract each node's value from the target as you descend, and the check at a leaf becomes trivial: does the remaining target equal the leaf's value? The recursion is a clean OR — a qualifying path…
Loading…
Subtract each node's value from the target as you descend, and the check at a leaf becomes trivial: does the remaining target equal the leaf's value? The recursion is a clean OR — a qualifying path…
Loading…