#K65482. Remove Duplicates from Employee List
Remove Duplicates from Employee List
Remove Duplicates from Employee List
You are given a list of employee names. Your task is to remove duplicate names from the list while preserving the order in which they first appear. For example, if the list is ["Alice", "Bob", "Alice", "Eve", "Bob"]
, the output should be ["Alice", "Bob", "Eve"]
.
Input Format: The first line contains an integer n, the number of employee names. The following n lines each contain a single name.
Output Format: Print the list of unique employee names in the order of their first appearance, separated by a single space. If there are no names, output nothing.
Note: Ensure that your solution reads from standard input (stdin) and writes to standard output (stdout).
inputFormat
The input begins with an integer n indicating the number of employee names.
Each of the next n lines contains a single employee name.
Constraints: 0 ≤ n ≤ 1000. Each name will be a non-empty string without spaces.
outputFormat
Output the employee names with duplicates removed while preserving their first occurrence order. The names should be printed on one line separated by a single space. If there are no names, print an empty line.
## sample5
Alice
Bob
Alice
Eve
Bob
Alice Bob Eve