Skip to content

Commit 87711b9

Browse files
authored
Update Linked List Cycle - Leetcode 141.py
1 parent 708329f commit 87711b9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Linked List Cycle - Leetcode 141/Linked List Cycle - Leetcode 141.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
class Solution:
22
def hasCycle(self, head: Optional[ListNode]) -> bool:
3-
dummy = ListNode()
4-
dummy.next = head
5-
slow = fast = dummy
3+
slow = fast = head
64

75
while fast and fast.next:
86
fast = fast.next.next

0 commit comments

Comments
 (0)