Skip to content

Latest commit

 

History

History
executable file
·
9 lines (5 loc) · 494 Bytes

437.md

File metadata and controls

executable file
·
9 lines (5 loc) · 494 Bytes

437. Path Sum III

Given the root of a binary tree and an integer targetSum, return the number of paths where the sum of the values along the path equals targetSum.

The path does not need to start or end at the root or a leaf, but it must go downwards (i.e., traveling only from parent nodes to child nodes).

DFS and record all past possible paths combinations?

YES! AC; attention: for (auto element: array) if we want to modify the elements, we need to add a symbol & before the element.