HTMLify

LeetCode - Assign Cookies - Python
Views: 109 | Author: abh
class Solution:
    def findContentChildren(self, g: List[int], s: List[int]) -> int:
        g.sort()
        s.sort()
        count = 0
        for c in s:
            if not g:
                break
            if c >= g[0]:
                count += 1
                g.pop(0)
        return count

Comments