Find Maximum Occurring Character
E · easyPracticestrings
Problem
Find the character that appears most frequently in a string. If tie, print the lexicographically smallest.
Example
Input
programming
Output
g
Frequency array of size 26. Track max frequency. In case of tie, smaller index wins.