Very simple Python solution better than 95.66%
\n\n\nclass Solution:\n    def minSwaps(self, s: str) -> int:\n        res = 0\n        stack = 0\n        for b in s:\n            if b == \'[\':\n            
\n\n```\nclass Solution:\n    def minSwaps(self, s: str) -> int:\n        res = 0\n        stack = 0\n        for b in s:\n            if b == \'[\':\n                stack += 1\n            elif not stack:\n                stack += 1\n                res += 1\n            else:\n                stack -= 1\n        return res\n ```
['Stack', 'Python']