LeetCode - Find Champion I - Python
Views: 154 | Author: abh
class Solution:
    def findChampion(self, grid: List[List[int]]) -> int:
        n = len(grid)
        strongerthancount = [0]*n
        for i in range(n):
            for j in range(n):
                if i != j:
                    strongerthancount[i] += grid[i][j]
        return strongerthancount.index(max(strongerthancount))


abh 2023-11-05 05:54

maybe i should have chosen a shorter variable name instead of strongerthancount :D