class Solution {
public int distributeCandies(int[] candyType) {
int len = candyType.length;
int canEat = len / 2;
Set<Integer> set =
Arrays.stream(candyType).boxed().collect(Collectors.toSet());
int answer = canEat > set.size() ? set.size() : canEat;
return answer;
}
}