/**
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
class Solution {
public:
ListNode* EntryNodeOfLoop(ListNode* pHead) {
unordered_set<ListNode*> Nodes;
while(pHead && !Nodes.count(pHead)){
Nodes.insert(pHead);
pHead = pHead->next;
}
return pHead;
}
};