Python with hash table and detailed explaination

It's a regular hash solution.
Go through all the candies and save each kind and the number into a dictionary.
Then compare the total number of candy kind and half of the candies number, since the sister and brother should get equal number of candies.
If the kind number is bigger than the half of the array, we should report the half of array.