Pregunta de entrevista de Yandex

DSA Round. Revert some part of linked list