🔥🔥🔥easy to understand [JAVA]
maximum number we can make == minimum number we can\'t make from array\nhow we can find minimum number ???\nAns:-SORT ARRAY\nwhy sort?? \nAns:-[[2] 1 5]]\nminel
**maximum number we can make == minimum number we can\'t make from array**\nhow we can find minimum number ???\nAns:-SORT ARRAY\nwhy sort?? \nAns:-[[2] 1 5]]\nminele=1\nminele is 1 first ele is greater than minele --itsfailed\nexample [ 1 3 ]\n   [1 **[2]** 3]   \n\n```\nclass Solution {\n    public int getMaximumConsecutive(int[] coins) {\n        Arrays.sort(coins);\n        int res=1;\n        \n        for(int ele:coins){\n            if(ele>res){\n                break;\n            }\n            res+=ele;\n        }\n        return res;\n    }\n}\n// 1 1 3 4 10\n```
['Greedy', 'Java']