Easy 5 Line Solution
Complexity\n- Time complexity:O(n), Where n is the upper limit of the range of numbers (from 1 to n)\n Add your time complexity here, e.g. O(n) \n\n- Space comp
# Complexity\n- Time complexity:O(n), Where n is the upper limit of the range of numbers (from 1 to n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(m), Where m is the number of elements in the banned list\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) {\n        int count = 0;\n        unordered_set<int> s(banned.begin(), banned.end());\n        for(int i = 1; i<=n; i++){\n            if(s.find(i) == s.end() && maxSum >= i){\n                count++;\n                maxSum -= i;\n            }\n        }\n        return count;\n    }\n};\n```
['Array', 'Hash Table', 'Greedy', 'C++']