def findContentChildren(g,s):
# cnt = 0
# i, j = len(g)-1, len(s)-1
# g, s = sorted(g), sorted(s)
# while min(i, j) >= 0:
# if g[i] <= s[j]:
# cnt += 1
# j -= 1
# i -= 1
# return cnt
g, s = sorted(g), sorted(s)
size = len(s)
while len(g) and len(s):
if g[-1] <= s[-1]:
s.pop()
g.pop()
return size - len(s)