https://leetcode.com/problems/find-champion-i/description/
Find Champion I - LeetCode
Can you solve this real interview question? Find Champion I - 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
leetcode.com
1 2 3 4 | class Solution: def findChampion(self, grid: List[List[int]]) -> int: new_grid = [sum(x) for x in grid] return new_grid.index(max(new_grid)) | cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2729. Check if The Number is Fascinating (0) | 2023.12.29 |
---|---|
leetcode 2903. Find Indices With Index and Value Difference I (0) | 2023.12.28 |
leetcode 2697. Lexicographically Smallest Palindrome (1) | 2023.12.28 |
leetcode 2828. Check if a String Is an Acronym of Words (0) | 2023.12.28 |
백준 14913 등차수열에서 항 번호 찾기 (0) | 2023.12.28 |
댓글