Sort a String
Basic Accuracy: 50.82% Submissions: 5977 Points: 1

Given a string consisting of lowercase letters, arrange all its letters in ascending order. 

Input:
The first line of the input contains T, denoting number of testcases. Then follows description of each testcase. The first line of the testcase contains positive integer N denoting the length of string. The second line contains the string.

Output:
For each testcase, output the sorted string.

Constraints:
1 <= T <= 100
1 <= N <= 100

Example:
Input:
1
5
edcab

Output:
abcde

Explanation:
Testcase 1:
The given string in sorted order of its letters is: abcde

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.