Given a list of employee email addresses and the merging information, find the correct department for each employee. The merging information is represented as a list of operations, where each operation is a tuple or array of three values: the current email, the merged employee's email, and the merged department.
100email@example.comThe input will be in the format of a list of operations, where each operation is a list or tuple of three values: the current email, the merged employee's email, and the merged department.
The output should be a dictionary or hash map where each key is an employee email and the value is the corresponding department.
The algorithm should aim for a time complexity of O(n) and a space complexity of O(n), where
nInput: {"input_data":[1,2,3]} Output: [1,2,3]
Solve problems, verify your skills, and earn XP.