Here is my code: https://ide.codingblocks.com/s/205869
What is missing in this?
You logic is wrong.
Maintain a frequency count of each character in an array. And finally print the character with maximum frequency.
Consider as case:
bbbbaaacbaaa
You o/p:
b
Expected o/p
a
I think my logic is right when I sorting the string before entering into my function
Is you code passing the test cases?
You should try using hashing concepts. It will be more efficient than sorting.
yes it pass all the test cases