with Time complexity :O(N) , Beats:68%👇
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nThis is One of the better approach..\n Describe your approach to solving 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nThis is One of the better approach..\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(N)\n- Runtime:150ms\n- Beats:68%\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(N)\n- space:177mb\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int maxCount(vector<int>& banned, int n, int maxSum) {\n        int cnt=0;\n        int sum=0;\n        unordered_set<int>st(banned.begin(),banned.end());\n        for(int i=1;i<=n;i++){\n            if(st.count(i)){\n                continue;\n            }\n            sum+=i;\n            if(sum > maxSum){\n                break;\n\n            }\n            cnt+=1;\n        }\n        return cnt;\n\n        \n    }\n};\n```
['C++']