Difficulty | Tags | Solution Link |
---|---|---|
Medium | [Linked Lists] | To Do |
Given the head node of a singly linked list, swap each pair of nodes and return the head. If there is a last odd node leave it in place.
Input | Output |
---|---|
1 -> 2 -> 3 -> 4 -> 5 | 2 -> 1 -> 4 -> 3 -> 5 |