CPP || Simple Solution || set
\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) {\n        set<int> set(banned.begin(), banned.end());\n        int sum = 
```\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) {\n        set<int> set(banned.begin(), banned.end());\n        int sum = 0, ans = 0;       \n        for (int i = 1; i <= n; i++) {\n            if (set.count(i) == 0 && maxSum >= sum + i) {\n                sum += i;\n                ans++;\n            }\n        }\n        return ans;\n    }\n};\n\n```
['Ordered Set', 'C++']