Sort String
Submissions: 3023   Accuracy:

53.59%

  Difficulty: Basic   Marks: 1

Given a string of lowercase characters from ‘a’ – ‘z’. We need to write a program to print the characters of this string in sorted order.

Input:
The first line contains an integer T, denoting number of test cases. Then T test case follows. First line of each test case contains a string S each.

Output:
For each test case, print the string S in sorted order.

Constraints:
1<=T<=100

1<=|S|<=4*10^4
String S will contains lowercase character from 'a'-'z

Example:

Input:
2
bbccdefbbaa

geeksforgeeks
Output :
aabbbbccdef
eeeefggkkorss

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

Author: ShivamKD


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.