there direct graph n node node label 0 n 1 the graph represent 0indexed 2D integer array graph graphi integer array nod adjacent node meaning edge node node graphiA node terminal node outgoing edge a node safe node possible path start node lead terminal node safe nodeReturn array contain safe node graph the answer sort ascending order Example 1input graph 1223505output 2456explanation the give graph show abovenode 5 6 terminal node outgoing edge themevery path start node 2 4 5 6 lead node 5 6example 2input graph 1234123404output 4explanationonly node 4 terminal node path start node 4 lead node 4 Constraintsn graphlength1 n 1040 graphilength n0 graphij n 1graphi sort strictly increase orderthe graph contain selfloopsthe number edge graph range 1 4 104