LinkedListSum
https://leetcode.com/discuss/interview-question/1546673/Amazon-or-OA-or-LinkedListSum
Give a linked list, which has even number of nodes, please return the maximum sum of PAIR
A pair means the node[i] and node[n-i], which n is linked list length.
example: [1,2,3,4,9,11]
1st pair sum: 1 + 11 = 13
2nd pair sum: 2 + 9 = 11
3rd pair sum: 3 + 4 = 7
Therefore, return 13
Please note that, you can only solve it with space complexity O(1)Last updated