Skip to content

Latest commit

 

History

History

character-with-longest-consecutive-repetition

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

For a given string s find the character c (or C) with the longest consecutive repetition and return:

Object[]{c, l};

where l (or L) is the length of the repetition. If there are two or more characters with the same l return the first in order of appearance.

For empty string return:

Object[]{"", 0}