js stack
\nvar minRemoveToMakeValid = function(s) {\n    let op = []\n    s = s.split(\'\')\n    for(let i=0; i<s.length; i++){\n        if(s[i]===\'(\') op.push(i)\n   
```\nvar minRemoveToMakeValid = function(s) {\n    let op = []\n    s = s.split(\'\')\n    for(let i=0; i<s.length; i++){\n        if(s[i]===\'(\') op.push(i)\n        if(s[i]===\')\') {\n            if(op.length) op.pop(); else s[i]=\'\'\n        }\n    }\n    while(op.length) s[op.pop()]=\'\';\n    return s.join(\'\')\n};\n```
['JavaScript']