You are viewing a single comment's thread. Return to all comments →
def getMinimumCost(k, c): c.sort(reverse = True) sum = 0 for idx, price in enumerate(c): sum += price * (1 + idx // k) return sum
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 →