rewrite leetcode binary tree maximum path sum