Easy C++ solution using stack✅✅
\n# Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) O(n)\n\n- Space complexity:\n Add your space complexity here, e.g. O(n) O(n)\n\n# 
\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->O(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int minSwaps(string s) {\n        stack<char> st;\n        for(char &ch:s){\n          if(ch==\'[\')  st.push(ch);\n          else if(!st.empty()) st.pop();\n        }\n        return (st.size()+1)/2;\n    }\n};\n```
['C++']