Middle Of A Linked List
easy
given a singly linked list with head node head, return a middle node of linked list. if there is 2 mid node then return first mid node.
Constraints
0 <= N <= 10^6
Format
Input
1->2->3->4->5->6->7->null 1->2->3->4->5->6->null
Output
4->5->6->7->null 3->4->5->6->null
Example
Sample Input
7
1 2 3 4 5 6 7
Sample Output
4 5 6 7
Question Video