Simple C++ Solution
Intuition\n# There is 1 observation here. so if we find the consecutive sequence till "x" then if we have new interger let say "val" then we can obtained a cons
# Intuition\n# **There is 1 observation here. so if we find the consecutive sequence till "x" then if we have new interger let say "val" then we can obtained a consecutive sequence  from 0 ... val+x . But only case when it is not possible is when x+1 < val.**\n\n# Approach\n1. Sort the coins array.\n2. Initialize the ans with 1, as 0 can be obtainable so we have to find from 1.\n3. We will traverse over each and every element of an coins array till coins[i]<=ans and add the coins[i] in our ans as per the intuition.\n4. Finally return the ans.\n\n# Complexity\n- Time complexity:\nO(nlogn+n)\n\n- Space complexity:\nO(1)\n\n# Code\n```\nclass Solution {\npublic:\n    \n    int getMaximumConsecutive(vector<int>& c) {\n        int n = c.size();\n        sort(c.begin(),c.end());\n        int ans=1;\n        for(int i=0;i<n && c[i]<=ans;i++){\n            ans += c[i];\n        }\n        return ans;\n    }  \n};\n```
['C++']