2
* @param {string[][]} accounts6
var accountsMerge = function (accounts) {10
for (let acc of accounts) {12
nameDict[acc[1]] = name;13
for (let i = 1; i < acc.length; i++) {14
if (!graph[acc[i]]) graph[acc[i]] = new Set();15
nameDict[acc[i]] = name;17
graph[acc[1]].add(acc[i]);18
graph[acc[i]].add(acc[1]);24
let visited = new Set();26
let dfs = function (key) {29
graph[key].forEach((e) => {30
if (!visited.has(e)) {31
emails.push(...dfs(e));38
for (let key in graph) {39
if (!visited.has(key)) {42
temp.unshift(nameDict[temp[0]]);