Given an integer array nums, return all values that appear more than once. Each duplicate value should appear only once in the output, and the output may be returned in any order.
Write a function that scans the array and identifies repeated values efficiently.
numsnumsdef find_duplicates(nums):