Hard
Find the maximum path sum anywhere in a binary tree.
A path may start and end at any nodes but must follow parent-child links. Return the maximum path sum.
Examples
Input: root = [1,2,3]
Output: 6
Constraints
- Nodes may contain negative values
Coding Challenge
Find the maximum path sum anywhere in a binary tree.
A path may start and end at any nodes but must follow parent-child links. Return the maximum path sum.
Input: root = [1,2,3]
Output: 6
Preparing your coding workspace...