Reverse Node Of Linkedlist In K Group
easy
1. Given a singly linklist, reverse the nodes of a linked list k at a time and return its modified linkedlist. 2. If number of nodes in multiple of k then it will reverse otherwise it will add inn the end of linkedlist without any change.
Constraints
1 <= size Of LinkedList <= 10^6 0 <= k <= 10^6
Format
Input
1->5->2->9->5->14->11->1->10->10->1->3->null 7
Output
11->14->5->9->2->5->1->10->10->1->3->null
Example
Sample Input
12
1 5 2 9 5 14 11 1 10 10 1 3
7
Sample Output
11 14 5 9 2 5 1 1 10 10 1 3