← 返回 amazon 的题目列表Find Duplicates in Integer List
类型:online_judge
Given a list of integers, write a function to identify the duplicate numbers in the list.
Input: An integer list nums.
Output: A list containing all duplicate numbers in the list.
Example:
Input: nums = [1, 2, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10]
Output: [6, 9]
Constraints:
The number of elements in the list is in the range of 1 to 10^4.
Each element is an integer in the range of -10^5 to 10^5.
Example
Input
1 2 3 3 4 5 6 6 7 8 9 9 10