Python Solution
\n# Code\npython3 []\nclass Solution:\n    def maxCount(self, banned: List[int], n: int, maxSum: int) -> int:\n        \n        if maxSum == 1 and maxSum in ba
\n# Code\n```python3 []\nclass Solution:\n    def maxCount(self, banned: List[int], n: int, maxSum: int) -> int:\n        \n        if maxSum == 1 and maxSum in banned:\n            return 0\n\n        d = {key: 1 for key in banned}\n\n        counter = 0\n        s = 0\n\n        for i in range(1, n + 1):\n            if i not in d:\n                if s + i <= maxSum:\n                    counter += 1\n                    s += i\n        \n        return counter\n```
['Array', 'Hash Table', 'Greedy', 'Sorting', 'Python3']