Around 6 lines, JAVA, Stack, Easy
\nclass Solution {\n    public int minSwaps(String s) {\n        Stack<Character> st = new Stack<>();\n        int n = s.length();\n        for(int i = 0; i < n
```\nclass Solution {\n    public int minSwaps(String s) {\n        Stack<Character> st = new Stack<>();\n        int n = s.length();\n        for(int i = 0; i < n; i++) {\n            char ch = s.charAt(i);\n            if(!st.isEmpty() && st.peek() ==\'[\' && ch == \']\')\n                st.pop();\n            else if(ch == \'[\')\n                st.push(ch);\n        }\n        return (st.size() + 1)/2;\n    }\n\n}\n```
['Stack', 'Java']