Skip to content

Commit 22ca727

Browse files
alternating_characters file added
1 parent f9fd5c6 commit 22ca727

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Strings/alternating_characters.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
int alternatingCharacters(String s) {
2+
int a=strlen(s);
3+
int k=0,i;
4+
for(i=0;i<a;i++)
5+
{
6+
if(s[i]==s[i+1])
7+
k++;
8+
}
9+
return k;
10+
}

0 commit comments

Comments
 (0)