EASY STRINGS

4.7

3 votes
Problem

You are given a string. Your task is to find out the character with maximum frequency in the given string. In case 2 characters have same frequency print the one with higher ASCII value.
Note : The input string contains only lower case alphabets

Input format :
● First line of input contains T ,the no. of test cases.
● The first line of each test case contains S ,the input string.

Output Format :
● For each test case, output a single line containing the character with maximum frequency and it’s count separated by a space.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?