Easy to Understand | Beginner Friendly | O(n) | 100% Faster 🦹🏻‍♀️🗡️
\npublic class Solution {\n    public int MaxCount(int[] banned, int n, int maxSum) {\n        HashSet<int> b1 = new HashSet<int>(banned);\n        int count= 0
```\npublic class Solution {\n    public int MaxCount(int[] banned, int n, int maxSum) {\n        HashSet<int> b1 = new HashSet<int>(banned);\n        int count= 0;\n        for(int i=1; i<= n && i <= maxSum; i++){\n            \n            if(!b1.Contains(i)){\n                count++;\n                maxSum -=i;\n            }\n        }\n        return count;\n    }\n}\n```
[]