You are viewing a single comment's thread. Return to all comments →
CPP
int sockMerchant(int n, vector<int> ar) { unordered_map<int, int> hashmap; for (int num : ar) { hashmap[num]++; } int total = 0; for (auto [num, count]: hashmap) { total += count / 2; } return total; }
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 →
CPP