All Ancestors of a Node in a Directed Acyclic Graph at Meta
Medium62.1% acceptance
This problem has 12.5% frequency at Meta.
Problem Description
You are given a positive integer `n` representing the number of nodes of a **Directed Acyclic Graph** (DAG). The nodes are numbered from `0` to `n - 1` (**inclusive**). You are also given a 2D integer array `edges`, where `edges[i] = [fromi, toi]` denotes that there is a **unidirectional** edge fro...
Read full problem and hintsTopics
Also asked at 3 companies
More Meta Questions
Binary Tree Right Side ViewMediumLowest Common Ancestor of a Binary TreeMediumDiameter of Binary TreeEasyShortest Path in Binary MatrixMediumSum Root to Leaf NumbersMedium
View all Meta questions