C# 1-liner | LINQ
Complexity\n\n- Time complexity: O(n)\n\n- Space complexity: O(n)\n\n# Code\n\ncsharp []\npublic class Solution {\n  public int MaxCount(int[] banned, int n, in
# Complexity\n\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n\n```csharp []\npublic class Solution {\n  public int MaxCount(int[] banned, int n, int maxSum) {\n    return Enumerable.Range(1, n).Except(banned).TakeWhile(x => (maxSum -= x) >= 0).Count();\n  }\n}\n\n```
['C#']