✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code\nTime complexity: O(n+m). Space complexit
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code\nTime complexity: $$O(n+m)$$. Space complexity: $$O(m)$$. m - len of b.\n```python3\nclass Solution:\n    def maxCount(self, b: List[int], n: int, M: int) -> int:\n        return sum(q<=M for q in accumulate(filter(lambda v,b={*b}:v not in b,range(1,n+1))))\n```\n\n(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be \'true\' oneliners - please, remind about drawbacks only if you know how to make it better)
['Array', 'Hash Table', 'Python', 'Python3']