Accounts Merge
Given a list of accounts where each account contains a name and emails, merge accounts belonging to the same person (accounts that share at least one common email).
Accounts Merge

Given a list of accounts where each account contains a name and emails, merge accounts belonging to the same person (accounts that share at least one common email).

Example 1:
Input
arr ={"accounts":[["John","[email protected]","[email protected]"],["John","[email protected]","[email protected]"],["Mary","[email protected]"],["John","[email protected]"]]}
Union
Group
Done

Initialize Union-Find structure

Variables
VariableValue
numAccounts4
DepthFunction Call
Stack empty
0/12