Adobe Interview Question

Topological sort in graph, longest sequence in array