1133. Largest Unique Number

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1133

class Solution:
    def largestUniqueNumber(self, nums: List[int]) -> int:
        cnt = Counter(nums)
        return max((x for x, v in cnt.items() if v == 1), default=-1)