✅C++ Easy and simple solution using Hash Map
\nGuy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F\n# 
\n***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***\n# Complexity\n- Time complexity:\nO(N)\n\n- Space complexity:\nO(N)\n\n# Code\n```\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) {\n        int count=0;\n        unordered_map<int,int>mapping;\n        for(auto i : banned){\n            mapping[i]++;\n        }\n        \n        long long sum=0;\n        for(int i=1;i<=n;i++){\n            if(mapping.find(i)==mapping.end()){\n                count++;\n                sum+=i;\n            }\n            if(sum>maxSum) return count-1;\n            \n            \n        }\n        \n        return count;\n        \n    }\n};\n```\n***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***
['Array', 'Hash Table', 'C++']