Priyanka and Toys

  • + 0 comments

    Here is my Python solution!

    def toys(w):
        minimum = min(w) + 4
        containers = 1
        w = sorted(w)
        for toy in w:
            if toy > minimum:
                minimum = toy + 4
                containers += 1
        return containers