# Interview - Victor Vannara ### Find All Numbers Disappeared in an Array > Given an array of `nums` of `n` integers where `nums[i]` is in the range `[1, n]`, return an array of ALL the integers in the range `[1, n]` that do not appear in `nums` Examples: `Input: nums = [4,3,2,7,8,2,3,3,6]` `Output: [1,5,9]` `Explanation: n = 9, the missing elements in this range are 1, 5, 9.` `Input: nums = [1,1,2]` `Output: [3]` `Explanation: n = 3, the missing element in this range is 3.` ```java= public List<Integer> disappeared(List<Integer> nums) { } ``` ``` ` Brute force: length of array. produce array within range with Natural interval. length 3 array, 'complete' -> [1, 2, 3] `Brute force: (loop) go through every item in the input, for x in input try and find in the 'complete array' `Brute force: if x is found, delete item in 'complete' ` Brute force: nums = [1, 1, 2] ` it finds 1 in 'complete' and removes that, doesn't find second '1' so it has nothing to remove, finds 2 and removes from 'complete' ` brute force: output: [3] ` with two arrays, going through every item in 'complete' as well as 'nums' array ` going through 'complete' for every single numbers in nums ` O(n^2) set is constant: O(n) `(notOptimized: sorted array O(n*log(n) * n^2) `nums = [4,3,2,7,8,2,3,3,6] ` ` ```