#25

Reverse Nodes in K Group

hard· Linked Listruns: 0

Given the head of a linked list, reverse the nodes of the list k at a time and return the modified head. k is a positive integer no larger than the length of the list. If the number of nodes is not a multiple of k, the remaining nodes at the end stay as they are. You may not alter the values; only nodes themselves may be changed.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.