Easy O(n) Solution using Set ✅
\n\n# Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \n    O(n) , for traversing from 1 to n.\n\n- Space complexity:\n Add your space
\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(n) , for traversing from 1 to n.\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(n) , where n is the number of elements in the banned list to make set for faster access.\n\n\n# Code\n```\nclass Solution:\n    def maxCount(self, banned: List[int], n: int, maxSum: int) -> int:\n        st=set(banned)\n        summ=0\n        ans=0\n        for i in range(1,n+1):\n            if summ+i<=maxSum and i not in st:\n                ans+=1\n                summ+=i\n        return ans\n    \n\n```
['Ordered Set', 'Python3']