[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;
}

Reference

Last updated