pass 104 easy
This commit is contained in:
parent
301d70cf8c
commit
0e9fec8a06
10
104-240525-pass/main.py
Normal file
10
104-240525-pass/main.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class Solution:
|
||||||
|
def hasCycle(self, head: Optional[ListNode]) -> bool:
|
||||||
|
cnt = 0
|
||||||
|
if head == None: return False
|
||||||
|
while cnt < 1e4+10:
|
||||||
|
if head.next == None:
|
||||||
|
return False
|
||||||
|
head = head.next
|
||||||
|
cnt += 1
|
||||||
|
return True
|
Loading…
Reference in New Issue
Block a user