What's wrong with this code

#include
#include
#include

using namespace std;
int main(){
char maxchar;
string s;
cin>>s;
long long int l=s.length();
int freq[l];
for(int i=0;i<l;i++){
freq[i]=1;
for(int j=i+1;j<l;j++){
if(s[i]==s[j] && s[i]!=‘0’){
freq[i]++;
s[j]=‘0’;

        }
    }
 }
int max;
max = freq[0];

for(int i = 0; i <l; i++) {
if(max < freq[i]) {
max = freq[i];
maxchar = s[i];
}
}
cout<<maxchar;
}

hello @vanshit02
pls save ur code at cb ide and share its link with me

which question is this ?

Strings-Max Frequency Character

check now

1 Like

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.