give direct acyclic graph n vertex number 0 n1 array edge edgesi fromi toi represent direct edge node fromi node toiFind small set vertex node graph reachable its guarantee unique solution existsnotice return vertex order Example 1input n 6 edge 0102253442output 03explanation its possible reach node single vertex from 0 reach 0125 from 3 reach 3425 so output 03example 2input n 5 edge 0121311424output 023explanation Notice vertex 0 3 2 reachable node include also vertex reach node 1 4 Constraints2 n 1051 edgeslength min105 n n 1 2edgesilength 20 fromi toi nAll pair fromi toi distinct