Beginner friendly javascript Solution
Time Complexity : O(n)\nwhere n is length of string\n\n/**\n * @param {string} s\n * @return {number}\n */\nvar minSwaps = function(s) {\n    let stk = []\n    
**Time Complexity : O(n)**\nwhere n is length of string\n```\n/**\n * @param {string} s\n * @return {number}\n */\nvar minSwaps = function(s) {\n    let stk = []\n    for(let c of s){\n        if(stk && c == \']\')    stk.pop()\n        else if(c == \'[\')   stk.push(c)\n    }\n    return (stk.length) / 2\n};\n```
['JavaScript']