Assign Cookies

Problem Id: 455 Difficulty: Easy


Intuition

Solution


class Solution(object):
    def findContentChildren(self, g, s):
        """
        :type g: List[int]
        :type s: List[int]
        :rtype: int
        """
        g.sort()
        s.sort()
        i = 0
        for size in s:
            if i >= len(g):
                break
            if size >= g[i]:
                i += 1
        return i