采用集合的方式解决 # -*- coding:utf-8 -*- # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def EntryNodeOfLoop(self, pHead): # write code here set1 = set() ### 一个集合 while pHead: if pHead.val not in set1: ...