Binary Tree Maximum Path Sum (LC #124) finds the maximum sum path between any two nodes. For each node, compute the max path sum that goes through it: node value plus max of left path and right path (if positive). Update a global maximum. Return the max single-branch path (node plus max of one child) for the recursive call. This distinction between what you track globally versus what you return locally is the trick. Runs in time and space. This is a hard problem Meta asks for senior roles.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/trees/binary-tree-maximum-path-sum
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████████████████