Easy Python Solution
Code\n\nclass Solution(object):\n    def maxCount(self, banned, n, maxSum):\n        banned = set(banned)\n        res, sum_, curr = 0, 0, 1\n        while curr
# Code\n```\nclass Solution(object):\n    def maxCount(self, banned, n, maxSum):\n        banned = set(banned)\n        res, sum_, curr = 0, 0, 1\n        while curr <= n:\n            if curr not in banned:\n                if sum_ + curr <= maxSum:\n                    res += 1\n                    sum_ += curr\n                else: break\n            curr += 1\n        return res\n```
['Python']