NIO interview question

Topological Sorting and 3 Sum