← 返回 salesforce 的题目列表Find Missing and Duplicate Number in an Array
类型:online_judge
salesforce
In an unsorted array with a range from 0 to n-1, find the missing number and the duplicate number. Assume the array is very large. How would you find these two numbers? Consider time and space complexity. Describe multiple solutions and provide test cases.
Example
Input
[3, 0, 1, 2, 3]