You are viewing a single comment's thread. Return to all comments →
Python
def getMinimumCost(k, c): n_flowers = len(c) c = sorted(c, reverse=True) price = 0 count = 0 for i in range(n_flowers): if i % k ==0 and i != 0 : count += 1 price += c[i] * (count + 1) # print(price) return price
Seems like cookies are disabled on this browser, please enable them to open this website
Greedy Florist
You are viewing a single comment's thread. Return to all comments →
Python