CT899

Marble ribbons Most Frequent Mark

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Legend says the vault under the gristmill of Rye Hollow opens only for a perfect tally of ribbons. Lara means to find out. Task: Read a lowercase string s and print the character that occurs most often. If several tie, print the alphabetically smallest. Input format: One line with a single lowercase string s. Output format: Print a single character. Constraints: 1 <= |s| <= 112; s contains lowercase English letters.

Example 1:

Input: wjtrtdu
Output: t

Example 2:

Input: hwhrlwnlminhqyohkilvkmmomdrecyghtuomrbnjunroaaqfqebzwqwrepaodcbqefbocmpsbgwduxrw
Output: m

Example 3:

Input: cmqrhxaptxelcdiososjhcmsmrfemmhllimlxgqkgxzqtvhozftfnrygrqvtnxbjaxqrangyvwgcnhqxpxvyovekhsxyfdphoexgauvx
Output: x

Constraints:

1 <= |s| <= 112; s contains lowercase English letters.

Loading...
Test Cases:No test cases
No test cases available.