Esempio n. 1
0
 public void alternatingCharactersTest()
 {
     Assert.AreEqual(3, AlternatingCharacters.alternatingCharacters("AAAA"));
     Assert.AreEqual(4, AlternatingCharacters.alternatingCharacters("BBBBB"));
     Assert.AreEqual(0, AlternatingCharacters.alternatingCharacters("ABABABAB"));
     Assert.AreEqual(0, AlternatingCharacters.alternatingCharacters("BABABA"));
     Assert.AreEqual(4, AlternatingCharacters.alternatingCharacters("AAABBB"));
 }
Esempio n. 2
0
 public void TestAlternatingCharacters()
 {
     // https://www.hackerrank.com/challenges/alternating-characters/problem
     Assert.AreEqual(3, AlternatingCharacters.alternatingCharacters("AAAA"));
     Assert.AreEqual(4, AlternatingCharacters.alternatingCharacters("BBBBB"));
     Assert.AreEqual(0, AlternatingCharacters.alternatingCharacters("ABABABAB"));
     Assert.AreEqual(0, AlternatingCharacters.alternatingCharacters("BABABA"));
     Assert.AreEqual(4, AlternatingCharacters.alternatingCharacters("AAABBB"));
 }