class Solution {
public:
ListNode* EntryNodeOfLoop(ListNode* pHead) {
map<ListNode*,int>mp;
while(mp[pHead]!=2&&pHead!=NULL){
mp[pHead]++;
pHead=pHead->next;
}
       
return pHead;
}
};
                        public:
ListNode* EntryNodeOfLoop(ListNode* pHead) {
map<ListNode*,int>mp;
while(mp[pHead]!=2&&pHead!=NULL){
mp[pHead]++;
pHead=pHead->next;
}
return pHead;
}
};



京公网安备 11010502036488号