Maximum frequency charcter

It is showing invalid conversion from strcpy(m,a);
Can you tell what is wrong in this code?

hello @shubhangis248 there is conversion problem .
could you please tell me what is the question for which you are implementing the code ?

Take as input S, a string. Write a function that returns the character with maximum frequency. Print the value returned.

What is wrong in my code?

you are making a character array that is creating the problem .
try do it with string you will be able to solve easiy .

still the same error on strcpy() function

@shubhangis248 wait i will give you the code for this

hey @shubhangis248 check this code :


this code can be even more optimised with the help of the unordered map (hashing).
if you dont uderstand anything in the code you can ask here .
if you feel that your doubt is resolved please mark this doubt as resolved and also give the star ratings in it .
Happy Learning !!

it is not passing any test cases

@shubhangis248 i have given you the general idea about how to solve the question .
but you have to do it according to the ouput format .
here is the correct code :


if you still have any doubt please ask here .
if your doubt is cleared please mark this doubt as resolved and give the stars rating .
Happy Learning !!