CT890

The Most Frequent Mark of Palemere

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Manav runs the apothecary at the salt flats of Palemere. Today the books show a list of inscriptions, and the numbers must be worked out before sundown. 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| <= 110; s contains lowercase English letters.

Example 1:

Input: lrxrkplserpkejkndbjqidhevtbixslopmpgiwsorkwyopvpidsrljhsmfmsbtdgaaaazejsniydpsheqegonrcdwwuunuqewptx
Output: p

Example 2:

Input: tnmsoqenefksxmvshjamhggvpuvcisg
Output: s

Example 3:

Input: gastwtglvwpooedxnqvgtbkiilqrqyxiwmiqagysshnmxszefnsknshhvimnxwuzvvvnrwxvbzayuzsczbiqxknbwhpetizvs
Output: s

Constraints:

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

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