Skip to content

Latest commit

 

History

History
executable file
·
8 lines (4 loc) · 210 Bytes

141.md

File metadata and controls

executable file
·
8 lines (4 loc) · 210 Bytes

141. Linked List Cycle

we can set a slow and fast pointer. slow = slow -> next, and fast = fast->next->next

Then, if there is a cycle, it's clear that the two pointers will meet each other.

Yes, accept!