Add the solution to "Reverse a doubly linked list".