Max frequency character

I cant get through the last test case, can someone unroll it for me

hi @sy7176442_ca8a8991a7ddc322
I have corrected ur code… it should pass all test cases now…
corrected code -->

#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main() {
	string ch;
    cin>>ch;
    
    int arr[128]= {0};
	for(int i=0;i< ch.length();i++){
        int n=ch[i];
        arr[n]++;
    }
    int maxi=-1, mn=0;
    for(int i=0;i< 128;i++){
        if(arr[i]>maxi){
            maxi=arr[i];
			mn=i;
        }
    }
    char ab= mn;
    cout<<ab;
	return 0;
}

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.