#K4386. Unique Email Alias Generation
Unique Email Alias Generation
Unique Email Alias Generation
You are given a list of employees with their first and last names. Your task is to generate a unique email alias for each employee. The alias for an employee is constructed using the format (firstname.lastname). If this alias has already been used, append the smallest positive integer (starting from 1) that makes it unique. For example, if the alias "john.doe" is already in use, the next occurrence should become "john.doe1", then "john.doe2", and so on.
The uniqueness check is case-sensitive and based on the exact string match.
inputFormat
The first line contains an integer (n) representing the number of employees. Each of the next (n) lines contains two space-separated strings: the first name and the last name of an employee.
outputFormat
Output (n) lines; each line should contain the unique email alias corresponding to the employee in the same order as input.## sample
3
john doe
jane doe
john smith
john.doe
jane.doe
john.smith
</p>