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