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

Linked List Cycle

Given a linked list, determine whether it contains a cycle. The input gives pos, the index of the node the tail's next pointer connects to (-1 means no cycle).

Constraints

0 <= n <= 10^4 -10^5 <= value <= 10^5 -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.