


Input: 'list' = [1, 2, 3, 4], 'k' = 2
Output: 2 1 4 3
Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.
All the node values will be distinct.
The first line of the input contains a single integer 'n', denoting the number of nodes in the linked list.
The second line contains 'n' space-separated integers, denoting the elements of the linked list.
The third line of input contains an integer 'k'.
Return the head of the modified linked list.
You don't need to print anything, just implement the given function. Contents of your returned linked list will be printed in a single line.