Coding

Reverse Nodes in k-Group

Reverse nodes in k-group in a linked list.

Input: head = [1,2,3,4,5], k = 3

Output: [3,2,1,4,5]

Explanation: The first 3 elements are reversed, while the remaining 2 are left untouched since they don't form a complete group.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

No answers yet

Be the first to share your approach to this question

Practice More Questions