c++ solution using Hashing
\nint getMaximumConsecutive(vector<int>& a) {\n        \n        map<int, int> mp;\n        \n        int n = a.size();\n        \n        for(int i=0;i<n;i++){
```\nint getMaximumConsecutive(vector<int>& a) {\n        \n        map<int, int> mp;\n        \n        int n = a.size();\n        \n        for(int i=0;i<n;i++){\n            if(!mp[a[i]]){\n                mp[a[i]] = 0;\n            }\n            mp[a[i]]++;\n        }\n        \n        int ans = 0;\n        \n        for(auto i : mp){\n            int x = i.first * i.second;\n            if(ans+1 >= (i.first)){\n                ans += x;\n            }\n            else\n            break;\n        }\n        return ans+1;\n    }\n```
[]