Binary tree maximum path sum.
Asked in the round 4 stage. Implement the function below using the nested-list tree representation.
root is either null or [value, left, right], where each child has the same representation. Return the largest sum of node values along any path. A path may start and end at any nodes, must follow parent-child connections, and cannot revisit a node.
def max_path_sum(root):