1980B
作者:
hayate
,
2024-06-05 16:33:57
,
所有人可见
,
阅读 9
#include <iostream>
#include <algorithm>
#include <cstring>
#include <unordered_map>
#include <set>
using namespace std;
int main()
{
int t;
cin >> t;
while(t -- )
{
int n;
string a;
cin >> n >> a;
set<char> u_str(a.begin(), a.end());
string b = string(u_str.begin(), u_str.end());
unordered_map<char, char> each_str;
for(int i = 0; i < b.length(); i ++ )
{
each_str[b[i]] = b[b.length() -i - 1];
}
string s;
for(auto t : a)
{
s += each_str[t];
}
cout << s << endl;
}
return 0;
}