The Question
CodingRedundant Connection in Directed Graph
Given a directed graph that was originally a rooted tree but now contains one additional directed edge, identify the edge that should be removed to restore its rooted tree structure. If multiple edges could be removed to satisfy this condition, return the one that appears latest in the input sequence.
Java
DSU
Graph
DFS
March 3, 2026