X1069: countCharClumps

Say that a "character clump" in a string is a series of 2 or more adjacent copies of the same character. Return the number of character clumps in the given string.

Examples:

countCharClumps("abbcdd") -> 2
countCharClumps("XXXXX") -> 1
countCharClumps("12345") -> 0

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.