575. Distribute Candies Poison 2023-08-19 Greedy 123456789101112class Solution { public int distributeCandies(int[] candyType) { int candies = candyType.length / 2; Set<Integer> typeSet = new HashSet<>(); for (int t : candyType) { typeSet.add(t); } return Math.min(candies, typeSet.size()); }} References575. Distribute Candies