binary tree maximum path sum, keep track of appendable sum and maxsum
candy, 2 scans, takes O(n) space