Linked List Cycle II Solutions in PythonNumber 142Difficulty MediumAcceptance 37.4%Link LeetCodeOther languages C++, GoSolutionsPython solution by haoel/leetcodedef detectCycle(self, head): slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if slow == fast: break if not fast or not fast.next: return None slow = head while slow != fast: slow = slow.next fast = fast.next return slowdef detectCycle(self, head): slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if slow == fast: break if not fast or not fast.next: return None slow = head while slow != fast: slow = slow.next fast = fast.next return slow