2144. Minimum Cost of Buying Candies With Discount

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2144

class Solution:
    def minimumCost(self, cost: List[int]) -> int:
        cost.sort(reverse=True)
        return sum(cost) - sum(cost[2::3])