fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. string s;
  7. cin>>s;
  8. unordered_map<char,int> mp;
  9. for(int i=0;i<s.size();i++){
  10. mp[s[i]]++;
  11. }
  12. string ans="";
  13. for(auto x:mp){
  14. ans.push_back(x.first);
  15. ans.push_back(x.second);
  16. }
  17. cout<<ans<<endl;
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5284KB
stdin
aaaBBBBhhhekkL
stdout
LBeakh