class Solution(object):
def findContentChildren(self, g, s):
"""
:type g: List[int]
:type s: List[int]
:rtype: int
"""
g.sort()
s.sort()
j=0
p=0
l=len(g)
for i in s:
if j<l and g[j]<=i:
p+=1
j+=1
return p
leetcode分发饼干
最新推荐文章于 2022-11-06 22:08:34 发布