Python solution


  • 0
    A
    class Solution:
        def findContentChildren(self, g, s):
            
            g.sort()
            s.sort()
            count = 0
            for greed in g:
                for size in s:
                    if(greed <= size):
                        count += 1
                        s.remove(size)
                        break
                    else:
                        continue
            
            return(count)
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.