From 9659e510f0cf258ac2c09e7d3f630c8dbf951dcf Mon Sep 17 00:00:00 2001 From: bumpsoo Date: Tue, 26 Nov 2024 22:54:06 +0900 Subject: [PATCH] https://leetcode.com/problems/find-champion-i --- easy/find_champion_i.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 easy/find_champion_i.py diff --git a/easy/find_champion_i.py b/easy/find_champion_i.py new file mode 100644 index 0000000..9681bff --- /dev/null +++ b/easy/find_champion_i.py @@ -0,0 +1,14 @@ +# https://leetcode.com/problems/find-champion-i +from typing import List + +class Solution: + def findChampion(self, grid: List[List[int]]) -> int: + max_sum = -1 + win = -1 + for i in range(len(grid)): + curr = sum(grid[i]) + if max_sum < curr: + win = i + max_sum = curr + return win +