Linked List Cycle II
Try to solve the Linked List Cycle II problem.
We'll cover the following
Statement
Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.
A cycle exists in a linked list if there is some node in the list that can be reached again by continuously following the next
pointer. Internally, pos
denotes the node’s index to which the tail’s next pointer is connected.
Constraints:
The number of the nodes in the list is in the range
. Node.val
pos
is -or a valid index in the linked list.
Note: The
pos
parameter isn’t passed as a parameter.