easy cpp soln
Complexity\n- Time complexity:\n    O(NLogN)\n\n- Space complexity:\n    O(1)\n\n# Code\n\nclass Solution {\npublic:\n    \n    int getMaximumConsecutive(vector
# Complexity\n- Time complexity:\n    O(NLogN)\n\n- Space complexity:\n    O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    \n    int getMaximumConsecutive(vector<int>& coins) \n    {\n        long long sum = 0;\n        int i =0;\n        sort(coins.begin(),coins.end());\n        while(sum<=1e10)\n        {\n            if(i<coins.size() && coins[i]<=sum+1)\n            {\n                sum+=coins[i];\n                i++;\n            }\n            else\n            {\n                return sum+1;\n            }\n        }\n        return sum+1;\n    }\n};\n```
['C++']