Problem 25 · Hard

Reverse Nodes in k-Group

Iteratively check k nodes ahead; if available, reverse that group and recurse on the remainder.

Open the interactive visualisation