function solution(nums) { const get = nums.length / 2; const noDuplication = [...new Set(nums)]; return get < noDuplication.length ? get : noDuplication.length; }