[Algo] Cycle in Graph (directed)
check if there is a cycle in a directed graph
Last updated
check if there is a cycle in a directed graph
Last updated
const edges = [
[1, 3],
[2, 3, 4],
[0],
[],
[2, 5],
[]
];
// true
function cycleInGraph(edges) {
return true;
}