String max frequency problem

1 test case is showing wrong answer
#include
#include
using namespace std;
char f(char a[]){
char t;
int h=strlen(a);
int count,max=0,y;
for(int i=0;i<h;i++)
{ count=0;
for(int j=i+1;j<h;j++)
{
if(a[j]==a[i]&&a[j]!=’’)
{
count++;
a[j]=’
’;
}
}
if(count>max)
{max=count;
t=a[i];}
}
return t;
}
int main() {
char a[1500];

cin>>a;
cout<<f(a);

return 0;

}

@mohit_99 Hey Mohit, What if only enter one character as string input (e.g “a”)
then your code is giving garbage character so dry run your code and check where you did mistake.