from root to leaf tree traverse problem (直上直下 )
Class2: 从root 往下,(直上直下) path。 key points : to carry 直上直下 path prefix while traversing the tree
小结: 如果必须是 root to leaf, 则base case is root.left == null && root.right == null. corner case is root == null
- Maximum path sum
- Path sum to target number