每日一题ing,今天是个简单题力扣455. Assign Cookies
class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(),g.end());
sort(s.begin(),s.end());
int child=0,cookie=0;
while(child<g.size()&&cookie<s.size())
{
if(g[child]<=s[cookie])
{
child++;
cookie++;
}
else
cookie++;
}
return child;
}
};