Skip to content

Commit f99cfb0

Browse files
authored
Update 2092-find-all-people-with-secret.js
1 parent 3bbaeb2 commit f99cfb0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

2092-find-all-people-with-secret.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const findAllPeople = function(n, meetings, firstPerson) {
1212
for(let i = 0, len = meetings.length; i < len; i++) {
1313
const [x,y,t] = meetings[i]
1414
if(i > 0 && t !== meetings[i - 1][2]) {
15-
dfs(start, links, shared)
15+
bfs(start, links)
1616
start = new Set()
1717
links = {}
1818
}
@@ -24,11 +24,10 @@ const findAllPeople = function(n, meetings, firstPerson) {
2424
links[y].push(x)
2525
}
2626

27-
28-
dfs(start, links, shared)
27+
bfs(start, links)
2928
return Array.from(shared)
3029

31-
function dfs(start, links, shared) {
30+
function bfs(start, links) {
3231
const visited = new Set()
3332
while(start.size) {
3433
const it = start[Symbol.iterator]()
@@ -42,5 +41,3 @@ const findAllPeople = function(n, meetings, firstPerson) {
4241
}
4342
}
4443
};
45-
46-

0 commit comments

Comments
 (0)