Whats wrong with my code, upon submitting it is not accepting

In string compression problem
I solved using map but it is not accepting. Please look code.

#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
map<char,int> hash;
for(int i=0;i<s.size();i++){
hash[s[i]]++;
}
for( auto i:hash){
cout<<i.first<<i.second;
}
return 0;
}

plz send the link of code

save your code at

and click file->save
then share the link

https://ide.codingblocks.com/s/381500

it give wrong answer in 2 testcase
because of order
for input
aaccbb
your ouput
a2b2c2
correct output
a2c2b2

order of character in the output should be same as given in the input

Correct Code

Basically i did not think this type of input.So thanks for attention such type of error

If your doubt is resolved , plz mark it as resolved from your side

Where is the option for marking it resolve?

in the bottom of any content(video or qeuestion) where you have asked this doubt
go there (in this case you have asked your doubt on a challenge “string-compression”)

at bottom you find same as this

now at bottom-right you find a option of “mark as resolved”