Given a string str. The task is to find the maximum occurring character in the string str. If more than one character occurs the maximum number of time then print the lexicographically smaller character.
str = testsample
Explanation: e is the character which
is having the highest frequency.
str = output
Explanation: t and u are the characters
with the same frequency, but t is
The task is to complete the function getMaxOccuringChar() which returns the character which is most occurring.
Expected Time Complexity: O(N). Expected Auxiliary Space: O(Number of distinct characters). Note: N = |s|