brute force
\nint maxCount(vector<int>& banned, int n, int maxSum) {\n        vector<int>ans;\n        int sum=0;\n        int c=0;\n        unordered_map<int,int>m;\n     
```\nint maxCount(vector<int>& banned, int n, int maxSum) {\n        vector<int>ans;\n        int sum=0;\n        int c=0;\n        unordered_map<int,int>m;\n        int n1=banned.size();\n        for(int i=0;i<n1;i++)\n        {\n            m[banned[i]]++;\n        }\n        for(int i=1;i<=n;i++)\n        {\n            ans.push_back(i);\n        }\n        for(int i=0;i<ans.size();i++)\n        {\n            if(m.find(ans[i])==m.end())\n            {\n                sum+=ans[i];\n                if(sum<=maxSum)\n                    c++;\n                else\n                    break;\n            }\n        }\n       return c;\n    }\n```
['C']