class Solution {
public int minSwaps(String s) {
int stackSize = 0;
for (char c : s.toCharArray()) {
if (c == '[') {
stackSize++;
} else {
if (stackSize > 0) {
stackSize--;
}
}
}
return (stackSize + 1)/2;
}
}
/**
[[]]
]]][[[
[]][][
[[][]]
]]][[[
c:1
o:0
[]]][[
1
*/