You are viewing a single comment's thread. Return to all comments →
int sockMerchant(int n, vector<int> ar) { int pair = 0; unordered_map<int, int> map; for(size_t i = 0; i < ar.size(); i++){ map[ar[i]]++; } for(auto it: map){ pair += (it.second / 2); } return pair; }
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →