#K75737. Sort Filenames in Lexicographical Order
Sort Filenames in Lexicographical Order
Sort Filenames in Lexicographical Order
You are given multiple test cases, each containing a list of filenames. Your task is to sort these filenames in lexicographical order (case-sensitive) for each test case.
The input begins with an integer , the number of test cases. For each test case, the first line contains an integer representing the number of filenames followed by lines, each containing a filename. After sorting each test case's filenames, output them consecutively, one filename per line.
Note: The lexicographical order follows standard character encoding where uppercase letters are considered less than lowercase letters.
inputFormat
The first line contains an integer () representing the number of test cases. For each test case, the first line contains an integer (), and the next lines contain a filename each.
outputFormat
For each test case, output the sorted filenames in lexicographical order, one per line. The output for all test cases should be concatenated together without any additional spaces or blank lines.## sample
2
3
banana
Apple
cherry
4
Zebra
elephant
dog
Cat
Apple
banana
cherry
Cat
Zebra
dog
elephant
</p>