How to solve it using hashmap
How to solve it using hashmap and normal way
hello @anmolaggarwal.432
store frequency of each character in ur map.
then iterate map and find which character has maximum frequency
and then print ur answer.
How can we access the second of the map
for(auto k : MAP){// if MAP is your map then
cout<<k.first; // it will give u key
cout<<k.second;// it will give u its value
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.