Given a linked list, you are asked to reverse it and print the resulting reversed linked list in the end.
Input
The input is handled automatically, you don’t need to do anything.
Output
The program should print the reversed linked list.
Examples
Input | Output |
5
4 5 6 1 -4 | -4 1 6 5 4 |