# Maximum Twin Sum of a Linked List (LeetCode 2130) Max of twin pairs via reverse half. ## Approach ```python def pairSum(head): slow = fast = head while fast and fast.next: slow = slow.next fast = fast.next.next prev = None while slow: nxt = slow.next slow.next = prev prev, slow = slow, nxt ans = 0 while prev: ans = max(ans, head.val + prev.val) head, prev = head.next, prev.next return ans ``` ## Complexity - Time / space depend on the scan above; keep the solution linear when possible. ## Interview tip Narrate the invariant before coding. I drill these patterns with [here](https://www.linkjob.ai/) ahead of OA rounds. *Disclosure: I work on Linkjob AI, an interview copilot. The algorithm above stands on its own.*