You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/6AXUA5_XwUw
vector<int> missingNumbers(vector<int> arr, vector<int> brr) { map<int, int> mp; for(int i = 0; i < brr.size(); i++) mp[brr[i]]++; for(int i = 0; i < arr.size(); i++) mp[arr[i]]--; map<int, int>::iterator it; vector<int> result; for(it = mp.begin(); it != mp.end(); it++) if(it->second > 0) result.push_back(it->first); return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/6AXUA5_XwUw