'''
keys: 
Solutions:
Similar:340
T:
S:
'''
from typing import List


class Solution:
    def findContentChildren(self, g: List[int], s: List[int]) -> int:
        g.sort()
        s.sort()
        res = 0
        pt_g, pt_s = 0, 0
        while pt_s < len(s) and pt_g < len(g):
            if s[pt_s] >= g[pt_g]:
                res += 1
                pt_g += 1
            pt_s += 1
        return res
    
sol = Solution()
print (sol.findContentChildren([10,9,8,7], [5,6,7,8]))