Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Binary Tree Maximum Path Sum
Hard
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given a binary tree, find the maximum path sum from any node to any node.
Sample Input:
[1,2,3]
Sample Output:
6
Hints
Hint 1
Path can go up and down the tree
Hint 2
For each node, calculate max path through it
Hint 3
Use post-order traversal to compute bottom-up
Code Editor
Reset
Run
Save
Loading...