very easy maths logic C++
\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        sort(coins.begin(), coins.end());\n        if (!coins.size()) return 1
```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        sort(coins.begin(), coins.end());\n        if (!coins.size()) return 1;\n        if(coins.size()==1 and coins[0]==1) return 2;\n        \n        //then we have 2 or more than 2\n        int max=0;\n        if(coins[0]==1){\n            max=1;\n            int i=1;\n            while(i<coins.size()){\n                //main logic\n                if (coins[i]<=max+1) max+=coins[i];\n                else break;\n                i++;\n            }\n            return max+1;\n        }\n        return 1;\n    }\n};\n```
['Sorting']