about | help | code help+videos | done | prefs |
Return a count of the number of characters in the string that are followed immediately by the same character. For example, countMatches("abbacccdd") should return 4 because the first b is followed by a b, the first c is followed by a c, the second c is followed by a c, and the first d is followed by a d. countPairs("abbacccdd") → 4 countPairs("abab") → 0 countPairs("xxx") → 2 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy