Sort the string in descending order
Submissions: 3969   Accuracy:

40.07%

  Difficulty: Basic   Marks: 1

Given a string S containing only lower case alphabets, the task is to sort it in lexigraphically-descending order.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains a string S.

Output:
For each test case, in a new line, print the sorted string.

Constraints:
1 <= T <= 100
1 <= |S| <= 105

Example:
Input:
2
geeks
for
Output:
skgee
rof

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

Author: arun03


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.