We’re preparing your current view and syncing the latest data.
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the integers of [1, n] inclusive that do not appear in this array. Return the result in any order.
An integer array nums of size n where 1 ≤ nums[i] ≤ n.
An array of integers representing the numbers in the range 1 to n that do not appear in nums.
1 <= nums.length <= 10^5, 1 <= nums[i] <= n
Example 1
Input
[4,3,2,7,8,2,3,1]
Output
[5,6]
Explanation
Numbers 5 and 6 do not appear in the array.