Interview Question. Practice implementing topological sort. Original solution has been modified for learning purposes.