Count all distinct kinds of candies and decide how many of them can be given to a sister:

```
public class Solution {
public int distributeCandies(int[] candies) {
return Math.min(candies.length / 2, (int) Arrays.stream(candies).distinct().count());
}
}
```