Given a directed acyclic graph with n vertices numbered 0 to n - 1 and an array edges where edges[i] = [from_i, to_i] is a directed edge from from_i to to_i, find the smallest set of vertices from which every node in the graph is reachable. A unique solution is guaranteed. You may return the vertices in any order.
Given a directed acyclic graph with n vertices numbered 0 to n - 1 and an array edges where edges[i] = [from_i, to_i] is a directed edge from from_i to to_i, find the smallest set of vertices from which every node in the graph is reachable. A unique solution is guaranteed. You may return the vertices in any order.