class Solution {
public int findContentChildren(int[] g, int[] s) {
int ans = 0;
int gIndex = 0;
int sIndex = 0;
Arrays.sort(g);
Arrays.sort(s);
while (gIndex < g.length && sIndex < s.length) {
if (s[sIndex] >= g[gIndex]) gIndex++; //只有当饼干的大小 大于等于 小孩的胃口的时候 才移动
sIndex++; //小孩数组的下标
}
return gIndex;
}
}



