one of the test cases is not working even thought i check with a lot of custom input and was getting a correct answer. Could someone please correct this also is there a better approach to this question (like using linear search etc)
# test case 0 not passing
Mentioned the change in comment : https://ide.codingblocks.com/s/364861
Yes better approach is using array
1.Declare an Array of 26 size to store the Freq of each character.
2.Each time any character is encountered increment its corresponding freq at that index.
3.Declare a max variable and put a loop on filled array.
4.Update the max and character accordingly.
oh so we are only talking about the alphabets? i thought it was all characters including special character like !,@ ,capital letters etc. otherwise would have tried the approach given above.
Yes in this case
…