题目描述
class Solution {
public:
ListNode* FindFirstCommonNode( ListNode *pHead1, ListNode *pHead2) {
map<ListNode *,int>mp;
mp.clear();
while(pHead1)
{
mp[pHead1]=1;
pHead1=pHead1->next;
}
while(pHead2)
{
if(mp[pHead2]) return pHead2;
pHead2=pHead2->next;
}
return NULL;
}
};
1483



被折叠的 条评论
为什么被折叠?



