[Java] greedy
\nclass Solution {\n    public int getMaximumConsecutive(int[] A) {\n        Arrays.sort(A);\n        int res=1;\n        for(int i=0;i<A.length;i++){\n        
```\nclass Solution {\n    public int getMaximumConsecutive(int[] A) {\n        Arrays.sort(A);\n        int res=1;\n        for(int i=0;i<A.length;i++){\n            if(A[i]>res)break;\n            res+=A[i];\n        }\n        \n        return res;\n        \n    }\n}\n```
[]