문제 링크 : Third Maximum Number
/** * @param {number[]} nums * @return {number} */ var thirdMax = function(nums) { nums = [... new Set(nums)].sort((a,b) => b-a) return nums.length < 3 ? nums[0] : nums[2] };