Reverse Nodes in k-Group
Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.
Reverse Nodes in k-Group

Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list.

Example 1:
Input: {"head":[1,2,3,4,5],"k":2}
Output: [2,1,4,3,5]
Input
arr ={"head":[1,2,3,4,5],"k":2}

Start

groupPrev

0

1

2

3

4

5

NULL
Variables
No variables to display
DepthFunction Call
Stack empty
0/11