1/**2 * @param {number[]} candies3 * @return {number}4 */5var distributeCandies = function(candies) {6 const types = new Set(candies).size;78 return Math.min(types, candies.length / 2)9};