✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\nTime complexity: O(n). Space complexity: O(1).\n
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\nTime complexity: $$O(n)$$. Space complexity: $$O(1)$$.\n```python3\nclass Solution:\n    def minSwaps(self, s: str) -> int:\n        return (max(accumulate(2*(c==\']\')-1 for c in s))+1)//2\n```
['String', 'Stack', 'Python', 'Python3']