1 # -*- coding:utf-8 -*- 2 # class ListNode: 3 # def __init__(self, x): 4 # self.val = x 5 # self.next = None 6 class Solution: 7 def EntryNodeOfLoop(self, pHead): 8 # write code here 9 plist = [] 10 while pHead: 11 if pHead in plist: 12 return pHead 13 else: 14 plist.append(pHead) 15 pHead = pHead.next