You are viewing a single comment's thread. Return to all comments →
this works perfectly
def has_cycle(head): x = [] while head: if head in x: return True else: x.append(head) head=head.next return False
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 →
this works perfectly