java || using stack
\nclass Solution {\n    public int minSwaps(String s) {\n        Stack<Character> st = new Stack<>();\n        for(int i = 0;i<s.length();i++){\n            if(
```\nclass Solution {\n    public int minSwaps(String s) {\n        Stack<Character> st = new Stack<>();\n        for(int i = 0;i<s.length();i++){\n            if(s.charAt(i)==\'[\'){\n                st.push(s.charAt(i));\n            }\n            if(s.charAt(i)==\']\'&&st.size()!=0&&st.peek()==\'[\'){\n                st.pop();\n            }\n            \n        }\n        if(st.size()%2==0){\n            return st.size()/2;\n        }else{\n            return (st.size()+1)/2;\n        }\n    }\n}\n```
['Java']