how to approach to question
String max frequency
You can take a frequency array and then update the count variable of all the characters present in the string⦠after that traverse the frequency array and keep on updating the value of max and keep on storing the maximum result obtain so far⦠This is the basic approach you can follow in your codeā¦
but we have to return the character ,not its frequency
You can keep storing the result inside a char variable and if u get a better result, update the value of char variableā¦