题目: 题解:
func findDisappearedNumbers(nums []int) (ans []int) {n : len(nums)for _, v : range nums {v (v - 1) % nnums[v] n}for i, v : range nums {if v < n {ans append(ans, i1)}}return
}
题目: 题解:
class Solution {
public:vector<int> findDisappearedNumbers(vector<int>& nums) {int n nums.size();for (auto& num : nums) {int x (num - 1) % n;nums[x] n;}vector<int> ret;for (int i 0; i < n;…