Max frequency (strings)

It is showing segmentation fault plz mark the error
here is the code:

Use map for this question

Which map please explain?

Unordered or ordered, both would work. Store the occurrence of each character in your map and then traverse it.