2 test case fail

#include
#include
using namespace std;
void sc(string s){
int f[26]={0},l=s.length();char x,y;
for(int i=0;i<l;i++){
x =s[i];
int d=x-‘a’;
f[d]++;

}
for(int i=0;i<26;i++){
    if(f[i]>0){
        y=i+'a';

        cout<<y<<f[i];
    }

}

}
int main()
{
string s;cin>>s;
sc(s);

return 0;

}

hi @yashtripathi6969_0cd127807d833066 dont just count and print frequency.
ans for aabaa a2b1a2 not a4b1, order is important

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.