Please enter your email address or userHandle.
Given a string str. The task is to find the maximum occurring character in the string str. If more than one character occurs maximum number of time then print the lexicographically smaller character.
The first line of input contains an integer T denoting the number of test cases. Each test case consist of a string in 'lowercase' only in a separate line.
For each testcase, in a new line, print the lexicographically smaller character which occurred the maximum time.
1 ≤ T ≤ 30
1 ≤ |s| ≤ 100
Testcase 1: e is the character which is having highest frequency.
Testcase 2: t and u are the characters with the same frequency, but t is lexicographically smaller.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.