1798. Maximum Number of Consecutive Values You Can Make
On This Page
class Solution:
def getMaximumConsecutive(self, coins: List[int]) -> int:
res = 1
for v in sorted(coins):
if v > res:
break
res += v
return res