Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def findWinners(self, matches: List[List[int]]) -> List[List[int]]:
- tally: dict = {}
- for match in matches:
- for team in match:
- tally[team] = 0
- for match in matches:
- tally[match[1]] += 1
- undefeated: list = [x for x in tally if tally[x] == 0]
- one_loss: list = [x for x in tally if tally[x] == 1]
- undefeated.sort()
- one_loss.sort()
- return [undefeated, one_loss]
Advertisement
Add Comment
Please, Sign In to add comment