How can you find the number of duplicates in a list?
Implement def count_duplicates(nums): for a list of integers and return the number of occurrences beyond each value's first appearance. An empty list returns 0, and all values are hashable integers.
def count_duplicates(nums):