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;
}
};