1163. Candies
Chinese
English
Given an even-numbered integer array, different numbers in the array represent different kinds of candy, and each number represents a kind of candy. You need to distribute these sweets evenly to your brother and sister. Return the maximum number of candy types that your sister can get.
Sample
输入: candies = [1,1,2,2,3,3]
输出: 3
解释:
有三种不同的糖果(1, 2 and 3), 每种糖果有两个。
最佳分法:妹妹拥有[1,2,3] ,弟弟也会拥有拥有[1,2,3]。
妹妹拥有3种不同的糖果。
Precautions
The length of the given array is [2, 10,000], and it is even.
The range of numbers in the given array is [-100,000, 100,000].