Shortest, Easiest, Clean & Clear | To the Point & Beginners Friendly Approach (❤️ ω ❤️)
Code\n\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        int x=1;\n        sort(coins.begin(),coins.end());\n        for(
# Code\n```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        int x=1;\n        sort(coins.begin(),coins.end());\n        for(auto i:coins){\n            if(i<=x)x+=i;\n            else break;\n        }\n        return x;\n\n//  if you like my approach then please UpVOTE o((>\u03C9< ))o\n    }\n};\n```\n\n![f5f.gif](https://assets.leetcode.com/users/images/0baec9b8-8c77-4920-96c5-aa051ddea6e4_1702180058.2605765.gif)\n![IUeYEqv.gif](https://assets.leetcode.com/users/images/9ce0a777-25fd-4677-8ccc-a885eb2b08f0_1702180061.2367256.gif)
['C++']