Skip to main content
hardBlind 75

Binary Tree Maximum Path Sum

Return the maximum path sum of any non-empty path Example: [1,2,3] => 6

Every node answers two questions in one post-order pass. Best path through me, and best value I hand my parent — never mixed.

TreesDynamic ProgrammingBFS / DFS

Meet Coco

Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Typing with Coco is free when you sign in, up to a daily limit. Talking with her out loud comes with the $79 pack. Anyone can open the editor and run their code.

1Binary Tree Maximum Path Sumhard