Back to DSA

Linked List Cycle II

medium
Acceptance: 48%
Linked List

Given a linked list that may contain a cycle, identify the node where the cycle begins. If no cycle is present, return null. The cycle entry point is the first node that is revisited when traversing the list.

Examples

Example 1:
Input:head = [1,3,5,7], pos = 1
Output:Node at index 1 (value 3)
Example 2:
Input:head = [2], pos = -1
Output:null

Hints

00:00
1234567