There are
n
teams numbered from0
ton - 1
in a tournament.Given a 0-indexed 2D boolean matrix
grid
of sizen * n
. For alli, j
that0 <= i, j <= n - 1
andi != j
teami
is stronger than teamj
ifgrid[i][j] == 1
, otherwise, teamj
is stronger than teami
.Team
a
will be the champion of the tournament if there is no teamb
that is stronger than teama
.Return the team that will be the champion of the tournament.
1 | class Solution { |