class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
vector<int> res;
int n=nums.size(),offset=n+1;
for(auto &num:nums)
{
int x=(num)%offset;
nums[x-1]+=offset;
}
for(int i=0;i<n;i++)
if(nums[i]<=offset)
res.push_back(i+1);
return res;
}
};
标签:num,数字,nums,int,Leetcode448,vector,数组,offset
From: https://www.cnblogs.com/tangxibomb/p/17589731.html