You are viewing a single comment's thread. Return to all comments →
Slightly better if I am not mistaken:
int toys(vector<int> w) { int cnt=0, x=-1; sort(w.begin(), w.end()); for(int i=0 ; i<w.size() ; i++) if(w[i]>x){ x=w[i]+4; cnt++; } return cnt; }
Seems like cookies are disabled on this browser, please enable them to open this website
Priyanka and Toys
You are viewing a single comment's thread. Return to all comments →
Slightly better if I am not mistaken: