# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def EntryNodeOfLoop(self, pHead): # write code here List=[] p=pHead while p: if p in List: return p else: List.append(p) p=p.next
# -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def EntryNodeOfLoop(self, pHead): # write code here List=[] p=pHead while p: if p in List: return p else: List.append(p) p=p.next