Write a function to find duplicates in a list. Return a new list containing each value that appears more than once, with each duplicate included only once and ordered by its second occurrence. Define the function as find_duplicates(nums); nums is a list of integers and the result is a list of integers. Return an empty list when no value occurs multiple times.
def find_duplicates(nums):