Skip to content

Commit fce897d

Browse files
authored
Create 2914. Minimum Number of Changes to Make Binary String Beautiful
1 parent aff6e89 commit fce897d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution {
2+
public:
3+
int minChanges(string s) {
4+
int cnt=0;
5+
for(int i=0;i<s.size();i+=2){
6+
if(s[i]!=s[i+1]) cnt++;
7+
}
8+
return cnt;
9+
}
10+
};

0 commit comments

Comments
 (0)