Dashboard Temp Share Shortlinks Frames API

HTMLify

455.py
Views: 407 | Author: abh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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