Adobe interview question

Topological sort in graph, longest sequence in array