Pergunta de entrevista da empresa Yandex

Write a code to reverse a double-linked list.