why my code doesn't work?


  • 0
    Y

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

        return count

Log in to reply
 

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