class Solution {
public:
map<ListNode*,int>mp;
ListNode* EntryNodeOfLoop(ListNode* pHead)
{
mp.clear();
while(pHead)
{
if(mp[pHead]) return pHead;
mp[pHead]=1;
pHead=pHead->next;
}
return NULL;
}
};