• + 0 comments

    My humble Python solution:

    def cutTheSticks(arr):
        result = []
        while arr:
            result.append(str(len(arr)))
            short = min(arr)
            arr = map(lambda x: x - short, arr) #Substruct the minimal value
            arr = list(filter(lambda x: x > 0, arr))
        
        return result