4. Repeated Values
Easy
Receive an array of integers and return the values that appear more than once, each value only once and in ascending order.
Example 1
Input: nums = [5,1,5,3,1,2]
Output: [1,5]
Example 2
Input: nums = [8,4,6]
Output: []
Constraints
- 0 <= nums.length <= 10000
- -100000 <= nums[i] <= 100000
ArraysHash map
Saved in this browser
Caso 1
nums =
[5,1,5,3,1,2]
Expected =
[1,5]
Caso 2
nums =
[8,4,6]
Expected =
[]
Run checks these 2 cases. Submit runs all 6, including hidden ones.