Nodes are `{ val, next }` objects. Implement `reverseList(head)` that reverses a linked list in-place and returns the new head. Example: `1→2→3→null` becomes `3→2→1→null`.
+ 1 hidden test run on Submit.
Walk the list re-pointing each node to its predecessor, saving the next node first. O(n) time, O(1) extra space.
Run your code to see results.