You are viewing a single comment's thread. Return to all comments →
Python Solution
def has_cycle(head): f = head.next s = head while f and s and f.next: if f == s: return 1 f = f.next.next s = s.next return 0
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Python Solution