**PROBLEM LINKS** contestcontest

**DIFFICULTY** Easy

**PREREQUISITES** concept of topological sort

**PROBLEM STATEMENT** Given N numbers of teams and dependency of each player to other players.

**Quick Explanation** To get the answer assume teams a graph and player as a node and work on in degree and out degree of each node to get answer.

**EDITORIALIST’S SOLUTION** here