You are viewing a single comment's thread. Return to all comments →
int toys(vector<int> w) { sort(w.begin(),w.end()); int c=0; size_t i = 0; while (i < w.size()) { int max = w[i] + 4; while (i < w.size() && w[i] <= max) { i++; } c++; } return c; }
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 →