• + 0 comments

    What is wrong with the below code -> It works in leedcode but fails here if head is None: return False #if head and head.next is None: # return False slow = head fast = head.next while slow: if slow == fast: return True if fast and fast.next: fast = fast.next.next else: return False slow = slow.next return False