Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Path Sum III
Bookmark
Input
Example 1
Example 2
Simple Tree
Custom
tree
=
[10, 5, -3, 3, 2, null, 11, 3, -2, null, 1]
,
targetSum
=
8
10
5
-3
3
2
11
3
-2
1
target = 0
paths = 0
prefix
count downward paths summing to
0
algo
master
.
io
Step:
Start: count every downward path that sums to the target
0 / 55
Input
Example 1
Example 2
Simple Tree
Custom
tree
=
[10, 5, -3, 3, 2, null, 11, 3, -2, null, 1]
,
targetSum
=
8
0 / 55
10
5
-3
3
2
11
3
-2
1
target = 0
paths = 0
prefix
count downward paths summing to
0
algo
master
.
io
Step:
Start: count every downward path that sums to the target