public int maxPathSum_Failed_Large(TreeNode root) {
        // Start typing your Java solution below
        // DO NOT write main() function
        if (root == null) {
            return 0;
        } else {
            int sum = root.val;
            if (root.left != null) {
                sum = Math.max(sum, maxPathSum(root.left));
            }
            if (root.right != null) {
                sum = Math.max(sum, maxPathSum(root.right));
            }
            sum = Math.max(sum, root.val + maxToRoot(root.left) + maxToRoot(root.right));

            return sum;
        }

    }