Find the tail of the given linked list
Given a linked list, you are asked to find the tail and print its value.
Input
The input is read automatically. You donโt need to do anything.
Output
The program should print the value of the tail of the given linked list.
Examples
Input | Output |
5
4 2 9 8 -4 | -4 |
ย
Constraints
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB