Max Frequency Character

Hello,

I am struck in one of the challenges under strings.

Question: ‘Strings-Max Frequency Character’. I have solved the question, but it is not passing one test case. I tried giving various custom inputs and code seems to work fine!

Can you please tell me where have I gone wrong?
I have attached the link to my code!

hello @meer
a) intiialise ur m with 1. and b with a[0]

check ur updated code here->

1 Like

Hello!
The code works fine!
But can you please tell me what was wrong with my code?

intialisation problem, u havent intialised b with any character (if there is only single character in ur string then ur code will produce garbage).

also u were initialsiing m with 0 but the correct value to initialise it is 1.

1 Like

Ohkayy!
Thanks a lot!