Skip to content

Commit 16ffbb2

Browse files
committed
Time: 3 ms (97.78%), Space: 44.9 MB (17.19%) - LeetHub
1 parent 16f1eaa commit 16ffbb2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public int minChanges(String s) {
3+
int cnt=0;
4+
for(int i=0;i<s.length()-1;i+=2){
5+
if(s.charAt(i)!=s.charAt(i+1)){
6+
cnt++;
7+
}
8+
}
9+
return cnt;
10+
}
11+
}

0 commit comments

Comments
 (0)