Skip to content
C

Find Middle Node

Easyjavapythonccppjavascript

Find the middle node of a singly linked list. If the list has an even number of nodes, return the second of the two middle nodes.

Input Format

The first line contains an integer N. The second line contains N space-separated integers.

Output Format

Print the value of the middle node.

Input (stdin)

Output

Run your code to see output here...