class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
int i=0,j=0;
sort(g.begin(),g.end());
sort(s.begin(),s.end());
while(j<size(s)&&i<size(g))
{
if(g[i]<=s[j]) i++;
j++;
}
return i;
}
};
分发饼干
最新推荐文章于 2024-05-29 20:05:54 发布