✅ 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 #1.1\nTime complexity: O(n^2). Space comp
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1.1\nTime complexity: $$O(n^2)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        return next((len(st) for q in sw if q not in st or st.remove(q)),0)\n```\n\n# Code #1.2 - Unwrapped\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        for q in sw:\n            if q not in st:\n                return len(st)\n\n            st.remove(q)\n\n        return 0\n```\n\n# Code #2.1\nTime complexity: $$O(n^2)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        return any(q not in st or st.remove(q) for q in sw)*0+len(st)\n```\n\n# Code #2.2 - Unwrapped\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        for q in sw:\n            if q not in st:\n                break\n\n            st.remove(q)\n\n        return len(st)\n```\n\n# Code #3.1 - Linear Approach\nTime complexity: $$O(n)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        return (c:=Counter(st)) and next((c[q^1] for q in sw if c[q]==0 or setitem(c,q,c[q]-1)),0)\n```\n\n# Code #3.2 - Shorter Version\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        return next((c[q^1] for q in sw if c[q]==0 or setitem(c,q,c[q]-1)),(c:=Counter(st))[2])\n```\n\n# Code #3.3 - Unwrapped\n```\nclass Solution:\n    def countStudents(self, st: List[int], sw: List[int]) -> int:\n        c = Counter(st)\n        for q in sw:\n            if c[q] == 0:\n                return c[q^1]\n\n            c[q] -= 1\n\n        return 0\n```\n\n(Disclaimer 2: all code above is just a product of fantasy, it is not claimed to be pure impeccable oneliners - please, remind about drawbacks only if you know how to make it better. PEP 8 is violated intentionally)
['Array', 'Counting', 'Python', 'Python3']