```
public class Solution {
public int findContentChildren(int[] g, int[] s) {
if(s==null || s.length<1) return 0;
int count=0;
int i=0;
int j=0;
Arrays.sort(g);
Arrays.sort(s);
while(i<g.length&&j<s.length){
if(s[j]>=g[i]){
i++;
j++;
count++;
}else if(s[j]<g[i]){
j++;
}
}
return count;
}
}
```