String max frequency character

i used my logic and i think it is correct but there is some error int the code i cant figure it out
here is the code:https://ide.codingblocks.com/s/249822

@jatinupadhyay786

  1. Return type of your maxfreq() function is string and you are returning char. So change line 5 to char maxFreq(string s , int len)
  2. line 27 and 28 should be enclosed in braces. So change these lines to
    if (arr[j] > max){
    max = arr[j];
    maxIndex=j;
    }

your code will work fine