1798. Maximum Number of Consecutive Values You Can Make

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

Содержание

LeetCode problem 1798

class Solution:
    def getMaximumConsecutive(self, coins: List[int]) -> int:
        res = 1
        for v in sorted(coins):
            if v > res:
                break
            res += v
        return res