Easy Solution Using Map || C++
Code\n\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum)\n    {\n        int sum = 0;\n        int count = 0;\n        \n    
# Code\n```\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum)\n    {\n        int sum = 0;\n        int count = 0;\n        \n        map<int, int> mp;\n        \n        for(auto x: banned)\n        {\n            mp[x]++;\n        }\n        for(int i = 1; i <= n; i++)\n        {\n            if((mp.find(i) == mp.end() and (sum + i) <= maxSum))\n            {\n                count++;\n                sum += i;\n            }\n        }\n        return count;\n    }\n};\n```
['C++']