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.

Community Answers

1 answer from the community

Unlock Full Access

Answer any un-answered question from our database to unlock all community answers for 30 days.

Give & Take

Practice More Questions