We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15a60ed commit 6f574b1Copy full SHA for 6f574b1
linked-list-cycle/printjin-gmailcom.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def hasCycle(self, head):
3
+ slow = fast = head
4
+ while fast and fast.next:
5
+ slow = slow.next
6
+ fast = fast.next.next
7
+ if slow == fast:
8
+ return True
9
+ return False
0 commit comments