Javascript Solution With Explanation
\n// we iterate from the smallest number while maintaining an integer sum. sum means that we can produce all number from 0 to sum.\n// when we can make numbers 
```\n// we iterate from the smallest number while maintaining an integer sum. sum means that we can produce all number from 0 to sum.\n// when we can make numbers from 0 to sum, and we encounter a new number, lets say arr[2].\n// it is obvious that we can create all numbers from sum to sum + arr[2].\n// if there is a gap if(arr[i] > sum+1) it means no combinations could create that number and we stop.\nvar getMaximumConsecutive = function(coins) {\n    coins.sort((a,b) => a-b);\n    let sum = 1;\n    for(let i = 0; i < coins.length; i++) {\n        if(coins[i] <= sum) {\n            sum += coins[i];\n        } else {\n            break;\n        }\n    }\n    return sum;\n};\n```
['JavaScript']