Sort the minions
All submissions for this problem are available.
Gru has started creating army of minions.Minions are funny creatures.
So he thought of naming them.The names of the minions are supposed to formed with similar characters.So he gave them names and stored safely in alphabetical order.But a naughty minion scrambled all the names.
So gru has to again order them.Unfortunately gru has to leave for shooting of Despicable Me 3 Shooting,So he is asking for your help.
- The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
- The first line in each test case contains a single integer N describing the no. of strings
- Then the next N lines each test case contains N strings
- For each test case, output the sorted strings one in each line.
- 1 ≤ T ≤ 100
- 0 ≤ N ≤ 100
- 1 ≤ |S| ≤ 1000
Input: 1 4 mace acme ecma came Output: acme came ecma mace
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, WSPC|
Fetching successful submissions