solved the 2 maximum path sum problems