12/25
虽然是水题,但我写了一堆bug,调了十几分钟QAQ
class Solution {
public int findContentChildren(int[] g, int[] s) {
int stg=0;
int sts=0;
Arrays.sort(g);
Arrays.sort(s);
while(stg<g.length&&sts<s.length){
while(g[stg]>s[sts]) {
if(++sts>=s.length){
return stg;
}
}
sts++;
stg++;
}
return stg;
}
}