Remove Even-Positioned Nodes from a Singly Linked List

Given the head of a singly linked list, remove every node at an even position and return the resulting head. Positions are 1-indexed, so nodes at positions 2, 4, 6, ... must be removed.

Preserv...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: