Algorithm · Amazon · Easy
Given an array of integers, create a function that returns the values that occur more than once. Input: An integer array named nums. Output: A list of every integer that appears multiple times in the array. Example: Input: nums = [2, 4, 5, 7, 8, 8, 11, 12, 14, 14] Output: [8, 14] Explanation: Both 8 and 14 occur twice, while every other number appears only once. Constraints: The list contains between 1 and 10^4 elements. Every value is an integer from -10^5 through 10^5.…
Checking your access…