same as patching array||c++||ditto same as patching array
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n   sort(coins.begin(),coins.end());\n        int sum=0;\n        int i=0;\n        while(i<coins.size())\n        {\n            if(coins[i]<=sum+1)\n            {\n                sum+=coins[i];\n                i++;//i++ yaha pe krnge ham..same logic as in patching array and minimum coin needed to make such that sum lies in rage from [1,target]\n            }\n            else\n            {\n               break;//loop se break kr ja is time kyuki consecutiveness yaha pe break ho jiga..mean vo number missing hai mean consecutiveness break hua na...to jaha consecutive break ho rha hai hame waha pe ruk jana hai bhai\n            }\n        }\n        return sum+1;\n    }\n};\n```
['C++']