In some country, there are n flights among n cities. Each city has an exactly one outgoing flight but may have no incoming flight or multiple incoming flights. Design an algorithm to find the largest subset S of cities such that each city in S has at least one incoming flight from another city in S. (hint: recall the in-degree array we used in developing the topological sort algorithm in class)
I'm a little lost about how to approach this problem. The in-degree array algorithm is used to perform a Topological sort, but how does that relate to solving this problem?