Group Linked List Nodes by Position Parity
Asked at Reddit · Coding Questions · Difficulty: Medium · Last asked Feb 14, 2026
You are given the head of a singly linked list. Reorder it so that all nodes in odd positions come first, followed by all nodes in even positions, and return the new head. Positions are 1-based by place in the list: the first node is odd, the second is even, and so on. This is about the position of a node, not its value. Within each group the original relative order is kept.
Loading the problem…