class Solution:
def smallestCommonElement(self, mat: List[List[int]]) -> int:
ans=set(mat[0])
for i in range(1,len(mat)):
ans=ans& set(mat[i])
return min(ans) if len(ans)>=1 else -1'알고리즘 문제 > Leetcode' 카테고리의 다른 글
| 921. Minimum Add to Make Parentheses Valid (0) | 2023.05.02 |
|---|---|
| 2330. Valid Palindrome IV (0) | 2023.05.02 |
| 2221. Find Triangular Sum of an Array (0) | 2023.05.02 |
| 2149. Rearrange Array Elements by Sign (0) | 2023.05.02 |
| 225. Implement Stack using Queues (0) | 2023.05.02 |