C++ (there was a leetcode problem really similar to this?)
Cannot remember the # of that problem. But the underlying algorithm is almost the same.\n\n\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int
Cannot remember the # of that problem. But the underlying algorithm is almost the same.\n\n```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        sort(coins.begin(), coins.end());\n        int sum = 0;\n        for(int i=0; i<coins.size(); i++) {\n            if(coins[i] > sum + 1) return sum + 1;\n            sum += coins[i];\n        }\n        \n        return sum + 1;\n    }\n};\n```
[]