Difficulty: Medium | Category: Graph | Asked at: Google, Meta, Amazon | Platform: Unfoldd Arena
Solve Accounts Merge online for free in Python, JavaScript, Java, C++, TypeScript, Go, Rust, PHP, Swift, Kotlin, Dart, Ruby, C, and C#. Practice Medium level coding interview problems with instant test case evaluation and AI-powered analysis.
Keywords: Accounts Merge solution, Accounts Merge leetcode, Accounts Merge python, Accounts Merge javascript,Accounts Merge java, Accounts Merge approach, how to solve Accounts Merge, medium coding problems, Graph problems, coding interview preparation, DSA practice free.
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.