MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / dfs

Function dfs

javascript/0684-redundant-connection.js:30–36  ·  view source on GitHub ↗
(graph, source, target, seen)

Source from the content-addressed store, hash-verified

28};
29
30const dfs = (graph, source, target, seen) => {
31 for (const neighbor of graph[source]) {
32 if (hasRedundantConnection(graph, neighbor, target, seen)) return true;
33 }
34
35 return false;
36};
37
38/**
39 * https://leetcode.com/problems/redundant-connection/

Callers 1

hasRedundantConnectionFunction · 0.70

Calls 1

hasRedundantConnectionFunction · 0.85

Tested by

no test coverage detected