You are viewing a single comment's thread. Return to all comments →
Hacky solution for the lulz:
def has_cycle(head): c = 0 while head: head = head.next c += 1 if c > 1000: return 1 return 0
Seems like cookies are disabled on this browser, please enable them to open this website
Cycle Detection
You are viewing a single comment's thread. Return to all comments →
Hacky solution for the lulz: