simple and easy C++ solution || Hash Table
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\ncpp []\nclass Solut
\n# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n###### Let\'s Connect on Linkedin: www.linkedin.com/in/shishirrsiam\n\n\n\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) \n    {\n        long ans = 0, sum = 0;\n        unordered_set<int>ban(begin(banned), end(banned));\n        for(int i = 1; i <= n; i++)\n        {\n            if(ban.count(i)) continue;\n            if(maxSum < sum + i) break;\n\n            ans += 1, sum += i;\n        }\n        return ans;   \n    }\n};\n```
['Array', 'Hash Table', 'Greedy', 'Sorting', 'C++']