LeetCode Solutions/Problems/1798. Maximum Number of Consecutive Values You Can Make..java
<reponame>DevashishPathrabe/LeetCode<filename>LeetCode Solutions/Problems/1798. Maximum Number of Consecutive Values You Can Make..javaclass Solution {
    public int getMaximumConsecutive(int[] coins) {
        Arrays.sort(coins);
        int n = coins.length;
        int current = 1;
        for (int i=0; i<n; i++){
            if (coins[i] <= current){
               current += coins[i];
            } else{
                break;
            }
        }
        return current;
    }
}