This code compile successfully and give correct output but can't pass any test case....!

#include

using namespace std;

#include

int main() {

string str;

getline(cin,str);

int count[256]={0};

int max=0;

int len=str.length();

cout<<str[0];

for(int i=0;i<len;i++){

count[str[i]]++;

}

for(int i=0;i<len;i+=count[str[i]]){

cout<<count[str[i]]<<str[i+count[str[i]]];

}

return 0;

}