Find Max Continuous Repeating Char

Given a string, return the character that is repeated the most number of times continuously. Note: Do not count the character that occurs most overall, but count only the character that occurs most number of times continuously Note: If two characters occur the same number of times continuously, return the first such in the string. Input : AABBBC Output : B Input : AAABBB Output : A

Answer

No comments:

Post a Comment