Tic-Tac-Toe are three cousins. They planned to play cricket this afternoon but got stuck…
- User
Tic-Tac-Toe are three cousins. They planned to play cricket this afternoon but got stuck in their homework. Mrs. Jaime assigned them a task to arrange all the letters in a scrambled word in the order of their appearance in english alphabets. All the letters are in upper-case. Help Tic-Tac-Toe to solve their homework so that they can play cricket. Input: First line of the input contains T, followed by T lines, each containing a scrambled word in upper-case.
Output: T lines, each containing arranged words.
Constraints: 1 ≤ T ≤ 500 | S ≤ 10^3 , Where S: Length of each scrambled word.
SAMPLE INPUT 4 INDIA PROGRAM HACKEREARTH COLOUR
SAMPLE OUTPUT ADIIN AGMOPRR AACEEHHKRRT CLOORU
Explanation
For the 1st test case, INDIA can be arranged as ADIIN. For the 2nd test case, PROGRAM can be arranged as AGMOPRR.
Assistant
# Read the number of test cases t = int(input()) for _ in range(t): # Read each word and sort the characters word = input().strip() sorted_word = ''.join(sorted(word)) print(sorted_word)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.