307995: CF1450A. Avoid Trygub
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Avoid Trygub
题意翻译
将一个字符串中的字符重新排列,使得 '`trygub`' 不是新字符串的子串。 例如, `trygub` 是 `atarayagauaba` 的子串。将它换个顺序以后, `atayaragauaba` 不是 `trygub` 的子串。 **本题每个测试点有多组数据,输入格式请参照样例。** Translated by @NSObject题目描述
A string $ b $ is a subsequence of a string $ a $ if $ b $ can be obtained from $ a $ by deletion of several (possibly, zero or all) characters. For example, "xy" is a subsequence of "xzyw" and "xy", but not "yx". You are given a string $ a $ . Your task is to reorder the characters of $ a $ so that "trygub" is not a subsequence of the resulting string. In other words, you should find a string $ b $ which is a permutation of symbols of the string $ a $ and "trygub" is not a subsequence of $ b $ . We have a truly marvelous proof that any string can be arranged not to contain "trygub" as a subsequence, but this problem statement is too short to contain it.输入输出格式
输入格式
The first line contains a single integer $ t $ ( $ 1\le t\le 100 $ ) — the number of test cases. The first line of each test case contains a single integer $ n $ ( $ 1\le n\le 200 $ ) — the length of $ a $ . The next line contains the string $ a $ of length $ n $ , consisting of lowercase English letters.
输出格式
For each test case, output a string $ b $ of length $ n $ which is a permutation of characters of the string $ a $ , and such that "trygub" is not a subsequence of it. If there exist multiple possible strings $ b $ , you can print any.
输入输出样例
输入样例 #1
3
11
antontrygub
15
bestcoordinator
19
trywatchinggurabruh
输出样例 #1
bugyrtnotna
bestcoordinator
bruhtrywatchinggura