HTMLify

LeetCode - Find Champion I - Python
Views: 172 | 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))

Comments

abh 2023-11-05 05:54

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