Priyanka and Toys

  • + 0 comments

    python

    def toys(w):
        w.sort()
        current_min = w[0]
        
        res = 1
        
        for toy in w:
            if toy > current_min + 4:
                current_min = toy
                res += 1
                
        return res