There are
nteams numbered from0ton - 1in a tournament.Given a 0-indexed 2D boolean matrix
gridof sizen * n. For alli, jthat0 <= i, j <= n - 1andi != jteamiis stronger than teamjifgrid[i][j] == 1, otherwise, teamjis stronger than teami.Team
awill be the champion of the tournament if there is no teambthat is stronger than teama.Return the team that will be the champion of the tournament.
1 | class Solution { |