Easiest C++ Solution...
\n\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:  O(1)\n Add your space complexity here, e.g. O(n) \
\n\n# Complexity\n- Time complexity: *O(n)*\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:  *O(1)*\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        int ans=0;\n        sort(coins.begin(), coins.end());\n        for(int i=0; i<coins.size(); i++){\n            if(ans+1>=coins[i]){\n                ans+=coins[i];\n            }\n        }\n        return ans+1;\n    }\n};\n```
['Array', 'Greedy', 'C++']