Given the head of a singly linked list, reverse the list and return the new head.
Walk the list with three pointers — prev, curr, next — and at each step flip curr.next to point at prev before advancing. The previous head becomes the tail; the previous tail becomes the new head.
Example: [1,2,3,4,5] → [5,4,3,2,1]. [1,2] → [2,1].
[5,4,3,2,1]