Problem Description
Given a linked list A , reverse the order of all nodes at even positions.
1 <= Size of linked list <= 100000
First and only argument is the head of the Linked-List A.
Return the head of the new linked list.
Input 1:
A = 1 -> 2 -> 3 -> 4
Input 2:
A = 1 -> 2 -> 3
Output 1:
1 -> 4 -> 3 -> 2
Output 2:
1 -> 2 -> 3
Explanation 1:
Nodes are positions 2 and 4 have been swapped.
Explanation 2:
No swapping neccassary here.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.