1798. Maximum Number of Consecutive Values You Can Make
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nPure math\n\n\ncoin value is <= sum+1\n\n\n\n# Complexity\n- Time complex
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nPure math\n\n`\ncoin value is <= sum+1\n`\n\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\n```\nvar getMaximumConsecutive = function (cs) {\n    cs.sort((a, b) => a - b)\n    let s = 0\n    for (let c of cs) {\n        if (c <= s + 1) {\n            s += c\n        }\n    }\n    return s + 1\n};\n```\n\n---\n
['JavaScript']