Pergunta de entrevista da empresa Agoda

Reverse Node in K-Groups taken straight from leetcode