You are viewing a single comment's thread. Return to all comments →
c++: `
int pairs(int k, vector<int> arr) { int ret = 0; set<int> lookup(arr.begin(), arr.end()); for(auto itr : arr) if(lookup.find(itr + k) != lookup.end()) ret++; return ret; }
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
c++: `