1class Solution {2 public int distributeCandies(int[] candyType) {3 Set<Integer> set = new HashSet<>();4 for (int type : candyType) set.add(type);5 return Math.min(set.size(), candyType.length / 2);6 }7}
WPM •0 •0
ACC •0 •0
TIME •0