You are viewing a single comment's thread. Return to all comments →
using C# public static int alternatingCharacters(string s) {
string initial = s.Substring(0,1); int delchar =0; for(int i=1;i<s.Length;i++) { if (initial.Trim() == s.Substring(i,1).Trim()) { delchar++; } else { initial = s.Substring(i,1).Trim(); } } return delchar; }
}public static int alternatingCharacters(string s) {
}
Seems like cookies are disabled on this browser, please enable them to open this website
Alternating Characters
You are viewing a single comment's thread. Return to all comments →
using C# public static int alternatingCharacters(string s) {
}public static int alternatingCharacters(string s) {
}