X248: maxBlock

Given a string, return the length of the largest "block" in the string. A block is a run of adjacent chars that are the same.

Examples:

maxBlock("hoopla") -> 2
maxBlock("abbCCCddBBBxx") -> 3
maxBlock("") -> 0
Reset

Practice a different Java exercise