2225. Find Players With Zero or One Losses
Содержание
class Solution:
def findWinners(self, matches: List[List[int]]) -> List[List[int]]:
cnt = Counter()
for a, b in matches:
if a not in cnt:
cnt[a] = 0
cnt[b] += 1
res = [[], []]
for u, v in cnt.items():
if v < 2:
res[v].append(u)
res[0].sort()
res[1].sort()
return res