Two test cases are failinh

can you please look why two test cases are failing.test case 0 and 3 are passing

Please save your code on ide.codingblocks.com and then share its link.

#include
#include<string.h>

using namespace std;
int main() {
string str1;
getline(cin,str1);

int arr[26]={0};
for(char j=‘a’;j<=‘z’;j++)
{
for(int i=0;i<str1.length();i++)
{
if(str1[i]==j||str1[i]==j-32)
arr[int(j)-97]++;
}}
for(int i=0;i<=25;i++)
if(arr[i]>0)
cout<<char(i+97)<<arr[i];

return 0;
}

Please paste your code on ide.codingblocks.com …then click on the save button.
And then copy the URL link and paste it here.

@akshatkaush
Consider a test case:
sskkkkkkwaerrtss

Expected Output:
s2k6w1a1e1r2t1s2

Your Output:
a1e1k6r2s4t1w1

Ok, understood the problem

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.