class Solution:

    def thirdMax(self, nums: List[int]) ->int:
        setNums = sorted(set(nums), reverse=True)
        return setNums[2] if len(setNums) >= 3 else setNums[0]

57b610ac45a199cce5f4767c36a3fd0e50d7d361
<mask token>

class Solution:
    <mask token>

class Solution:

    def thirdMax(self, nums: List[int]) ->int:
        setNums = sorted(set(nums), reverse=True)
        return setNums[2] if len(setNums) >= 3 else setNums[0]
