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 hints

Topics

Also asked at 3 companies


More Meta Questions

View all Meta questions