Reverse a linked list
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 |
ย
Constraints
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB