JS || Solution by Bharadwaj
Code\n\nvar getMaximumConsecutive = function (coins) {\n    coins.sort((a, b) => a - b);\n    let count = 0;\n    for (let coin of coins) {\n        if (coin <=
# Code\n```\nvar getMaximumConsecutive = function (coins) {\n    coins.sort((a, b) => a - b);\n    let count = 0;\n    for (let coin of coins) {\n        if (coin <= count + 1) {\n            count += coin;\n        }\n    }\n    return count + 1;\n};\n```
['JavaScript']