Very easy c++ solution || Stack usage
\n# Code\ncpp []\nclass Solution {\npublic:\n    int minSwaps(string s) {\n        stack<char>st;\n        int cnt=1;\n        for(auto it:s){\n            if(i
\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minSwaps(string s) {\n        stack<char>st;\n        int cnt=1;\n        for(auto it:s){\n            if(it==\'[\') st.push(\'[\');\n            else{\n                if(!st.empty() && st.top()==\'[\') st.pop();\n                else {\n                    st.push(\']\');\n                    cnt++;\n                    }\n                }\n            }\n        return cnt/2;\n    }\n};\n```
['C++']