```
public class Solution {
public int FindContentChildren(int[] g, int[] s) {
int k=0;
Array.Sort(g);
Array.Sort(s);
for(int i=0;i<s.Length;i++)
{
if(k<g.Length && s[i]>=g[k])
k++;
else if(k>g.Length)
break;
}
return k;
}
}
```