标签:style cookies span end nbsp children ntc cto ret
class Solution { public: int findContentChildren(vector<int>& g, vector<int>& s) { sort(g.begin(), g.end()); sort(s.begin(), s.end()); int child = 0; int cookies = 0; while(child < g.size() && cookies < s.size()) { if(g[child] <= s[cookies]) child++; cookies++; } return child; } };
标签:style cookies span end nbsp children ntc cto ret
原文地址:https://www.cnblogs.com/randyniu/p/9310962.html