Skip to content

Commit a2e06fc

Browse files
committed
Runtime: 178 ms (Top 47.19%) | Memory: 33.6 MB (Top 28.32%)
1 parent 5c23b86 commit a2e06fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/algorithms/M/Minimum Number of Swaps to Make the String Balanced/Minimum Number of Swaps to Make the String Balanced.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 178 ms (Top 47.19%) | Memory: 33.6 MB (Top 28.32%)
12
class Solution {
23
public:
34
int minSwaps(string s) {
@@ -10,15 +11,14 @@ class Solution {
1011
if(s[i]==']' && stack.size()!=0 && stack.top()=='['){
1112
stack.pop();
1213
}
13-
14+
1415
}
15-
16+
1617
ans=stack.size();
1718
if(ans%2==0)
1819
return ans/2;
1920
else
2021
return (ans+1)/2;
21-
2222

2323
}
24-
};
24+
};

0 commit comments

Comments
 (0)