方法一
java">class Solution {public int findChampion(int[][] grid) {int j=0;for(int i=1;i<grid.length;i++){if(grid[j][i]==0)j=i;}return j;}
}
python">class Solution(object):def findChampion(self, grid):j=0for i in range(len(grid)):if grid[j][i]==0:j=ireturn j
方法二
java">class Solution {public int findChampion(int[][] grid) {int count=0;for(int i=0;i<grid.length;i++){count=0;for(int j=0;j<grid[0].length;j++){if(grid[i][j]==1){count++;}}if(count==grid.length-1){return i;}}return 0;}
}
python">class Solution(object):def findChampion(self, grid):count=0for i in range(len(grid)):count=0for j in range(len(grid[0])):if grid[i][j]==1:count+=1if count==len(grid)-1:return ireturn 0