string b is an aftereffect of a string an if b can be gotten from a by cancellation of a few (conceivably, zero or all) characters. For instance, "xy" is an aftereffect of "xzyw" and "xy", yet not You are given a string a. Your errand is to reorder the characters of a so that "trygub" isn't an aftereffect of the subsequent string
Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science.
A string b is an aftereffect of a string an if b can be gotten from a by cancellation of a few (conceivably, zero or all) characters. For instance, "xy" is an aftereffect of "xzyw" and "xy", yet not
You are given a string a. Your errand is to reorder the characters of a so that "trygub" isn't an aftereffect of the subsequent string
All in all, you should find a string b which is a stage of images of the string an and "trygub" isn't an aftereffect of b
We have a genuinely superb confirmation that any string can be sorted out not to contain "trygub" as an aftereffect, however this issue explanation is too short to even think about containing it
Inpu
The primary line contains a solitary integer t (1≤t≤100) — the number of experiments
The primary line of each experiment contains a solitary integer n (1≤n≤200) — the length of a
The following line contains the string an of length n, comprising of lowercase English letters
Outpu
For each experiment, output a string b of length n which is a change of characters of the string a, and to such an extent that "trygub" isn't an aftereffect of it
If there exist numerous potential strings b, you can print any.. t . . . t . . . "yx".

Step by step
Solved in 4 steps with 1 images









