c++ | easy | fast
\n\n# Code\n\nclass Solution {\npublic:\n        int getMaximumConsecutive(vector<int>& A) {\n        sort(A.begin(), A.end());\n        int res = 1;\n        f
\n\n# Code\n```\nclass Solution {\npublic:\n        int getMaximumConsecutive(vector<int>& A) {\n        sort(A.begin(), A.end());\n        int res = 1;\n        for (int a: A) {\n            if (a > res) break;\n            res += a;\n        }\n        return res;\n    }\n};\n```
['C++']