✅ 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 - One Line\nTime complexity: O(n). S
(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 - One Line\nTime complexity: $$O(n)$$. Space complexity: $$O(n)$$.\n```\nclass Solution:\n    def minRemoveToMakeValid(self, s: str) -> str:\n        return (q:=0) or \'\'.join(\'\'.join((q:=q+(c==\'(\')-(c==\')\'),c)[1] for c in s if q or c!=\')\').rsplit(\'(\',q))\n```\n\n# Code #1.2 - Unwrapped\n```\nclass Solution:\n    def minRemoveToMakeValid(self, s: str) -> str:\n        result, q = [], 0\n        for c in s:\n            if q or c != \')\':\n                q += (c == \'(\') - (c == \')\')\n                result.append(c)\n\n        return \'\'.join(\'\'.join(result).rsplit(\'(\', q))\n```\n\n# Code #2 - [Regular Solution](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/solutions/3410191/elegant-and-fast-approach/)\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)
['String', 'Python', 'Python3']