#include
#include<bits/stdc++.h>
#include
using namespace std;
int main()
{ string s1;
getline(cin,s1);
int h;
int count=1;
sort(s1.begin(),s1.end());
string s2=“0”;
s1.insert(s1.size(),s2);
for(int i=0;i<s1.size()-1;i++)
{
if(s1[i]==s1[i+1])
count++;
else
{ cout<<s1[i]<<count;
count=1;
}
}
return 0;
}
1-getting error in one output cases while submission.
2-want to know any other best way to do this.only hint not whlole code