Given an array 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.

&nbsp;
Example 1:
Input: nums = [4,3,2,7,8,2,3,1]
Output: [5,6]
Example 2:
Input: nums = [1,1]
Output: [2]

&nbsp;
Constraints:


	n == nums.length
	1 &lt;= n &lt;= 105
	1 &lt;= nums[i] &lt;= n


&nbsp;
Follow up: Could you do it without extra space and in O(n) runtime? You may assume the returned list does not count as extra space.

class Solution:
    def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
        return set(nums) ^ set(range(1,len(nums)+1))
class Solution {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> res = new ArrayList<>();
        // 0 1 2 3 4 5 6 7 <- indx
        // 4 3 2 7 8 2 3 1 <- nums[i]
        for(int i=0;i<nums.length;i++) {
            int indx = Math.abs(nums[i])-1;
            if(nums[indx]>0) {
                nums[indx] = nums[indx]*-1;
            }
        }
        // 0 1 2 3 4 5 6 7 <- indx
        // -4 -3 -2 -7 8 2 -3 -1 <- nums[i]
        for(int i=0;i<nums.length;i++) {
            if(nums[i]>0) {
                res.add(i+1);
            }else {
                nums[i] *= -1;
            }
        }
        // [ 5, 6]
        return res;
    }
}
class Solution {
public:
    vector<int> findDisappearedNumbers(vector<int>& nums) {
        vector<int> res;
        int n = nums.size();
        for (int i = 0; i < n; i++) {
            if (nums[abs(nums[i]) - 1] > 0) {
                nums[abs(nums[i]) - 1] *= -1;
            }
        }
        for (int i = 0; i < n; i++) {
            if (nums[i] > 0)
                res.push_back(i + 1);
        }
        return res;
    }
};
var findDisappearedNumbers = function(nums) {
    let result = [];
    for(let i = 0; i < nums.length; i++) {
        let id = Math.abs(nums[i]) - 1;
        nums[id] = - Math.abs(nums[id]);
    }
    for(let i = 0; i < nums.length; i++) {
        if(nums[i] > 0) result.push(i + 1);
    }
    return result;
};
Find All Numbers Disappeared in an Array