Skip to content

Commit 65c1d09

Browse files
committed
Runtime: 6 ms (Top 63.59%) | Memory: 7 MB (Top 71.84%)
1 parent 82b80ad commit 65c1d09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 6 ms (Top 63.59%) | Memory: 7 MB (Top 71.84%)
12
class Solution {
23
public:
34
int minOperations(string s) {
@@ -8,14 +9,14 @@ class Solution {
89
for(int i = 1; i<s.size(); i+=2){
910
if(s[i]!='1') start0++;
1011
}
11-
12+
1213
for(int i = 0; i<s.size(); i+=2){
1314
if(s[i]!='1') start1++;
1415
}
1516
for(int i = 1; i<s.size(); i+=2){
1617
if(s[i]!='0') start1++;
1718
}
18-
19+
1920
return min(start0, start1);
2021
}
21-
};
22+
};

0 commit comments

Comments
 (0)