https://programmers.co.kr/learn/courses/30/lessons/1845
import java.util.*;
class Solution {
public int solution(int[] nums) {
Set<Integer> set = new HashSet<>();
for(int i=0;i<nums.length;i++){
if(!set.contains(nums[i])){
set.add(nums[i]);
}
}
return nums.length/2<=set.size() ? nums.length/2 : set.size();
}
}