Given the head of a singly linked list, group all nodes at odd positions together followed by all nodes at even positions, and return the reordered list. Positions are 1-indexed (the head is position 1, which is odd).
You should keep the relative order of the odd-positioned nodes and the relative order of the even-positioned nodes unchanged, and solve it in place in O(1) extra space (not counting the output).
Input / output
head: ListNodeListNodeCan you do it in a single pass, without counting the list's length first?