Monk's Birthday Party
Practice
4 (123 votes)
Easy
Open
Hashmap
Hash table
Approved
Problem
70% Success 18921 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Monk's birthday is coming this weekend! He wants to plan a Birthday party and is preparing an invite list with his friend Puchi. He asks Puchi to tell him names to add to the list.
Puchi is a random guy and keeps coming up with names of people randomly to add to the invite list, even if the name is already on the list! Monk hates redundancy and hence, enlists the names only once.
Find the final invite-list, that contain names without any repetition.

Input:
First line contains an integer T. T test cases follow.
First line of each test contains an integer N, the number of names that Puchi pops up with.

Output:
For each testcase,Output the final invite-list with each name in a new line. The names in the final invite-list are sorted lexicographically.

Constraints:
1 ≤ T ≤ 10
1 ≤ N ≤ 105
1 ≤ Length of each name ≤ 105

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
150 votes
Tags:
EasyOpenHash functionHash table
Points:20
111 votes
Tags:
MapSortingEasyHash tableData Structures
Points:20
9 votes
Tags:
OpenApprovedHashingEasy