[Algo] Cycle in Graph (directed)
check if there is a cycle in a directed graph

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

const edges = [
  [1, 3],
  [2, 3, 4],
  [0],
  [],
  [2, 5],
  []
];
// true
function cycleInGraph(edges) {
  return true;
}Last updated