- 思路很巧妙
class Solution {
public:
int getMaximumConsecutive(vector<int>& coins) {
sort(coins.begin(),coins.end());
int x = 0;
for(int y:coins)
{
if(y > x + 1) break;
x = x + y;
}
return x + 1;
}
};
标签:1798,int,coins,构造,数目,LeetCode
From: https://www.cnblogs.com/zjacky/p/17091734.html