833. Reverse k Sized Sublists
Given a singly linked list of size N, you need to reverse the nodes of the linked list in groups of size K. If the length of the linked list is not a multiple of K, the remaining part should be left unchanged.
The first line contains two space-separated integers N and K. The second line contains N space-separated integers representing the elements of the singly linked list.
Print the modified linked list.
5 2 1 2 3 4 5
2 1 4 3 5
1<=N<=10^5 1<=K<=N Elements of the linked list range from -10^9 to 10^9