Solution to problem 18, max path sum pyramid