Reverse Even Nodes in a Linked List

Given a singly linked list, reverse the nodes at even positions.

Statement

Given a singly linked list, reverse the nodes at even positions and return the linked list.

Example

Let’s take the below linked list as an example:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.