simple and easy solution using unordered map
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```cpp []\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) {\n        int sum=0, bsize=banned.size(), count=0;\n        unordered_map<int, int> ump;\n        for(int i=0; i<bsize; i++) ump[banned[i]] = 1;\n        for(int i=1; i<=n; i++) {\n            if(ump[i]==1) continue;\n            sum+=i;\n            if(sum>maxSum) break;\n            count++;\n        }\n        return count;\n    }\n};\n```
['C++']