Linked List Cycle
Given head, the head of a linked list, determine if the linked list has a cycle in it. A cycle exists if there is some node that can be reached again by continuously following the next pointer.
Linked List Cycle

Given head, the head of a linked list, determine if the linked list has a cycle in it. A cycle exists if there is some node that can be reached again by continuously following the next pointer.

Example 1:
Input: {"head":[3,2,0,-4],"pos":1}
Output: true
Input
arr ={"head":[3,2,0,-4],"pos":1}

Init: slow = head, fast = head

slowfast

3

2

0

-4

To 2
Variables
No variables to display
DepthFunction Call
Stack empty
0/12