Python | Leetcode Python题解之第455题分发饼干
题目:
题解:
class Solution:def findContentChildren(self, g: List[int], s: List[int]) -> int:g.sort()s.sort()m, n = len(g), len(s)i = j = count = 0while i < m and j < n:while j < n and g[i] > s[j]:j += 1if j < n:count += 1i += 1j += 1return count