Linked List Cycle

Given the head of a linked list, determine whether the list contains a cycle.

The test input is provided as a values array plus a pos index. If pos >= 0, the tail connects to the node at that index; if pos = -1, the list is acyclic.

Examples
Input: [[3,2,0,-4],1]
Output: true
Hints
Related Problems

Linked List Cycle

Given the head of a linked list, determine whether the list contains a cycle.