Apple interview question

Topological sort