Easy JavaScript Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * @param {number[]} coins\n * @return {number}\n */\nvar getMaximumConsecutive = function (coins) {\ncoins.sort((a,b) => a- b);\nlet reach = 0;\nlet i = 0;\nwhile (i < coins.length) {\nif (i < coins.length && coins[i] <= reach + 1) {\nreach += coins[i];\ni++;\n} else {\nbreak;\n}\n}\nreturn reach + 1;\n};\n```
['JavaScript']