[Java / Python / C++] Clean and Correct solution
Java:\n\nclass Solution {\n   int getMaximumConsecutive(int[] coins) {\n        Arrays.sort(coins);\n        int val=0;\n        for(int i : coins){\n          
**Java:**\n```\nclass Solution {\n   int getMaximumConsecutive(int[] coins) {\n        Arrays.sort(coins);\n        int val=0;\n        for(int i : coins){\n            if(i <= val+1)\n                val += i;\n            else\n                break;\n        }\n        return val+1;\n    }\n}\n```\n\n**Python:**\n```\nclass Solution:\n    def getMaximumConsecutive(self, coins: List[int]) -> int:\n        val = 0\n        for i in sorted(coins):\n            if i <= val+1:\n                val+=i\n            else:\n                break\n        return val+1\n```\n\n**C++:**\n```\nclass Solution {\npublic:\n    int getMaximumConsecutive(vector<int>& coins) {\n        sort(coins.begin(),coins.end());\n        int val=0;\n        for(int i : coins){\n            if(i <= val+1)\n                val += i;\n            else\n                break;\n        }\n        return val+1;\n    }\n};\n```
[]