There are n teams numbered from
You are given a two dimensional integer matrix grid of size i and j, grid[i][j] == 1 denotes that team i is stronger than team j, whereas grid[i][j] == 0 denotes that team j is stronger than team i.
A team is the champion if there is no other team that is stronger than it.
Return the team that is the champion.
Constraints:
n == grid.length
n == grid[i].length
n
grid[i][j] is either
For all i, grid[i][i] is
For all i, j such that i != j, grid[i][j] != grid[j][i].
The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.
There are n teams numbered from
You are given a two dimensional integer matrix grid of size i and j, grid[i][j] == 1 denotes that team i is stronger than team j, whereas grid[i][j] == 0 denotes that team j is stronger than team i.
A team is the champion if there is no other team that is stronger than it.
Return the team that is the champion.
Constraints:
n == grid.length
n == grid[i].length
n
grid[i][j] is either
For all i, grid[i][i] is
For all i, j such that i != j, grid[i][j] != grid[j][i].
The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.