Sort a String
Submissions: 4284   Accuracy:

48.35%

  Difficulty: Basic   Marks: 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

** For More Input/Output Examples Use 'Expected Output' option **

Author: dipjal1996


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.