← All problems
Reverse Nodes in k-Group
Reverse the list k nodes at a time; leave the remainder as-is.
Complexity
Time O(n), Space O(n/k) recursion
Common pitfalls
- Reversing a short final group
- Losing the connection between groups
Your solution
Log in to save your code and track progress.