← 返回 coinbase 的题目列表Longest Consecutive Character in String
类型:online_judge
Given a string, output the longest consecutive character and its length. If there are multiple longest sequences, output the one that is furthest to the right.
Input: A non-empty string consisting only of alphabetic characters.
Output: The output should be a string containing the longest consecutive character and its length. If there are multiple sequences of the same length, return the rightmost one. For example, given the input "aaabbc", the output should be "b2".
Example
Input
aaabbc