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

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.