
Given an integer array nums, return all values that appear more than once. Each duplicated value should appear only once in the result, and the result may be returned in any order.
nums = [1, 2, 3, 2, 4, 1]Output[1, 2]Why1 and 2 both occur more than once.nums = [5, 5, 5, 5]Output[5]WhyOnly 5 is duplicated, so it appears once in the output.`1 <= nums.length <= 10^5``-10^9 <= nums[i] <= 10^9`Return each duplicated value only once