View Code of Problem 36

#include<iostream>
#include<map>
using namespace std;

int main()
{
	int t;
	cin >> t;
	while(t --)
	{
		string s;
		cin >> s;
		map<char,int> mp;
		for(int i = 0;i < s.size();i ++) mp[s[i]] ++;
		for(auto x : mp) cout << x.second << x.first;
		cout << endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 36