Practice Find Champion I
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
There are n teams numbered from 0 to n - 1 in a tournament. Given a 0-indexed 2D boolean matrix grid of size n * n. For all i, j that 0 <= i, j <= n - 1 and i != j team i is stronger than team j if grid[i][j] == 1, otherwise, team j is stronger than team i. Team a will be the champion of the tournament if there is no team b that is stronger than team a. Return the team that will be the champion of the tournament.
Source: Find Champion I on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
grid = [[0,1],[0,0]]
0
# Example 2
grid = [[0,0,1],[1,0,1],[0,0,0]]
1
Constraints
Related LeetCode Problems
Practice more problems similar to Find Champion I.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.