1833. Maximum Ice Cream Bars

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1833

class Solution:
    def maxIceCream(self, costs: List[int], coins: int) -> int:
        costs.sort()
        for i, c in enumerate(costs):
            if coins < c:
                return i
            coins -= c
        return len(costs)