function solution(nums) {
const pick = nums.length / 2;
const hash = new Set();
for(let i = 0; i < nums.length; i++){
hash.add(nums[i]);
};
if(hash.size < pick){
return hash.size;
}
return pick;
}
function solution(nums) {
const max = nums.length / 2;
const arr = [...new Set(nums)];
return arr.length > max ? max : arr.length
}