What happens if the node number is odd? Should we swap the last node with NULL?
Nope. You have to swap from head to tail in pairs so in odd cases, the last node will remain un-swapped (if that is an English word at all but it makes the point). -> 1 -> 2 -> 3 -> would become -> 2 ->1 -> 3 ->
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.