0 ms solution
Intuition\nTry to get min possible values from the range.\n\n# Approach\nDefault solution can be a bit improved with using an array.\n\n\n\n# Complexity\n- Time
# Intuition\nTry to get min possible values from the range.\n\n# Approach\nDefault solution can be a bit improved with using an array.\n![Screenshot 2024-12-06 at 4.19.48\u202FAM.png](https://assets.leetcode.com/users/images/f7275f65-42e4-4c34-a50a-e220461adc91_1733448192.380244.png)\n\n\n# Complexity\n- Time complexity: $$O(N)$$ \n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(N)$$ \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```golang []\nvar bannedMap [10E4+1]bool\n\nfunc maxCount(banned []int, n int, maxSum int) int {\n    clear(bannedMap[:min(n, maxSum)+1])\n    for _, v := range banned {\n        bannedMap[v] = true\n    }\n    var s, c int\n    for x := 1; x <=  min(n, maxSum); x++{ \n        if bannedMap[x] {\n            continue\n        }\n        if s+x > maxSum {\n            break\n        }\n        s += x \n        c++\n    }\n\n    return c\n}\n```
['Go']