CAN I HAVE A HINT FOR THIS PROBLEM??
Maxfrequencycharacter
hi @sharma.shubham
u take input from the user it consist of like
babadbsg
now u have to find char with max frequency like here b
now u know that there are 26 alphabets
so u can create a array of size 26 intially 0 in all
and then u can increament the position according to the character
like this
for(iterating length of char array){
a[int(c[i]-97)++ //because a start from 97 and i mapped a with 0 index and subsequent other also
}
now find max in the a array and get it index and cout char(97+i)
1 Like