Earthquake and the Paint Shop
Submissions: 325   Accuracy:


  Difficulty: Basic   Marks: 1

Chunky's Paint Shop is one of the famous shop in BantaLand. But 2014 Earthquake caused disarrangement of items in his shop.
Now Chunky wants to retain reputation of his shop, for that he has to arrange items in order.
Each item has 40 digit alpha numeric code .
Your task is to arrange the items in ascending order and print them along with their count.

First line of the input contains T, the number of test cases. Each line of the test case contains N(no of items) followed by N strings.

For each test case print the code of sorted items along with their count. 


2234597891 zmxvvxbcij 8800654113 jihgfedcba
1234567891 zxyabcvapo 0123434908 padmadngaa
1234567891 abcdefghij 9876543219 jihgfedcba
2234597891 zmxvvxbcij 8800654113 jihgfedcba
9120121291 zmxvvxbcij 0912114113 mnvxbedcba
1234567891 abcdefghij 9876543219 jihgfedcba 1
1234567891 zxyabcvapo 0123434908 padmadngaa 1
2234597891 zmxvvxbcij 8800654113 jihgfedcba 2
9120121291 zmxvvxbcij 0912114113 mnvxbedcba 1

We have 5 items here. Each item has a 40 digit alpha-numeric code. We arrange the items based on the lexiographical order of their alpha-numeric code. The items that are similar are printed only once. The count of the items describes how many such items are there, so items that appear more than once have their count greater than 1.

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

Contributor: chunky_2808
Author: Chunky_2808

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, generate link and share the link here.

to report an issue on this page.