The Republic Day speech
All submissions for this problem are available.
On the occasion of 66th Republic day, a young lad, Lemon Kumar (a.k.a Yaar Kumar), is revising his speech again and again to remember it. He found that some of the letters in his
speech is repeated quite often. Being very fond of programming, like the Chef, he took it as a challenge and decided to find this letter. He decided that:
- He will count the frequency of all English alphabets only and will consider upper case letters as lower case for counting.
- If two letters have same frequency he will consider letter with high ASCII value.
As he is getting late for his speech so he
decided to appoint you to do this job for him.
First line contains the number of test cases T.
For each test case you are given a string(speech) containing any character in a single line.
For each test case print a lower case letter on a single line whose frequency is maximum in his speech.
- 1 ≤ T ≤ 100
- 1 ≤ Length of the speech ≤ 105
Input: 1 Happy Republic Day!!! Output: p
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions