Saved from https://leetcode-cn.com/problems/distribute-candies/
func distributeCandies(candies []int) int { count := map[int]bool{} for _, c := range candies { count[c] = true } if len(candies)/2 < len(count) { return len(candies)/2 } return len(count) }