mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 23:07:08 +00:00
Removing old questions
Removed questions uploaded using an old version of LeetHub Questions 2,3,4,19,36,141,206
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
# Definition for singly-linked list.
|
||||
# class ListNode(object):
|
||||
# def __init__(self, x):
|
||||
# self.val = x
|
||||
# self.next = None
|
||||
|
||||
class Solution(object):
|
||||
def hasCycle(self, head):
|
||||
"""
|
||||
:type head: ListNode
|
||||
:rtype: bool
|
||||
"""
|
||||
if head == None or head.next == None: return False
|
||||
myDict = {head: 0}
|
||||
point = head
|
||||
while True:
|
||||
point = point.next
|
||||
if point == None: return False
|
||||
if myDict.get(point) == None:
|
||||
myDict[point] = 0
|
||||
else:
|
||||
return True
|
||||
Reference in New Issue
Block a user