Algorithm · Two Sigma · Medium
Given a directed acyclic graph (DAG), decide whether node A can reach node B through directed edges. The input is provided in three pieces: the total node count, the edge list, and the query's starting and ending nodes. Example Input: Example Output: Explanation: Node 0 can get to node 5, for example by following 0 → 2 → 3 → 5, so the answer is Yes. Example
Checking your access…