760. Find All Repeating Elements in an Array
Given an integer array nums, return all elements that appear more than once in the array. You may return the answer in any order.
Example 1:
Input: nums = [1, 1, 2, 3, 4, 4, 5, 2]
Output: [1, 2, 4]
Explanation: Elements 1, 2, and 4 appear more than once.
Example 2:
Input: nums = [1, 1, 0]
Output: [1]
Explanation: Only element 1 appears more than once.
Now Your Turn!
Pick the correct output for the given inputInput: nums = [3, 5, 3, 2, 8, 5, 6]
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= nums.length <= 105
- -109 <= nums[i] <= 109