easy java solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
import java.util.Arrays;

class Solution {
    public int getMaximumConsecutive(int[] coins) {
        Arrays.sort(coins); // Sort coins to work sequentially
        int count = 0; // Start with 0 consecutive values

        for (int i = 0; i < coins.length; i++) {
            if (coins[i] > count + 1) {
                break; // Stop if a gap is found
            }
            count += coins[i]; // Add the current coin to the consecutive range
        }

        return count + 1; // Add 1 to include "0" in the count
    }
}

```
['Java']