Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Binary Tree Maximum Path Sum
Bookmark
Input
Example 1
Example 2
All Negative
Custom
tree
=
[-10, 9, 20, null, null, 15, 7]
-10
9
20
15
7
maxSum
?
a path bends at one node and uses at most two arms
algo
master
.
io
Step:
Start: the max path can bend at any node and use any two of its arms
0 / 37
Input
Example 1
Example 2
All Negative
Custom
tree
=
[-10, 9, 20, null, null, 15, 7]
0 / 37
-10
9
20
15
7
maxSum
?
a path bends at one node and uses at most two arms
algo
master
.
io
Step:
Start: the max path can bend at any node and use any two of its arms