Easy Python
\nclass Solution:\n    def minSwaps(self, s: str) -> int:\n        lks=[]\n        for x in s:\n            if len(lks)==0:\n                lks.append(x)\n    
```\nclass Solution:\n    def minSwaps(self, s: str) -> int:\n        lks=[]\n        for x in s:\n            if len(lks)==0:\n                lks.append(x)\n            elif lks[-1]==\'[\' and x==\']\':\n                lks.pop()\n            else:\n                lks.append(x)\n        k=len(lks)//2 + 1\n        return k//2\n```
[]