37. Middle of the Linked List

Return the middle node of a linked list. With two middle nodes, return the second one.

Example 1

Input: head = [1,2,3,4,5]
Output: [3,4,5]

Example 2

Input: head = [1,2,3,4]
Output: [3,4]
Hint 1

Fast and slow pointers: when fast reaches the end, slow is halfway.

Linked ListTwo Pointers