Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Linked List Cycle II (Find Cycle Start)

Given a linked list whose tail connects to the node at index pos (-1 for no cycle), print the index of the node where the cycle begins, or -1 if there is no cycle.

Constraints

0 <= n <= 10^4 -1 <= pos < n

Discussion

No discussions yet.

Rewards · v2.1

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.