Complexity is O(n) Time and O(1) space - Negate values at position, mark it as negative, when it negates to same position and its value is negative, push it to the result :) Simple, good luck and best wishes to everyone

```
class Solution {
public:
vector<int> findDuplicates(vector<int>& nums) {
vector<int> res;
for (int i = 0; i < nums.size(); i++){
int m = abs(nums[i]) - 1;
if (nums[m] > 0) {
nums[m] = - nums[m];
continue;
}
else res.push_back (m+1);
}
return res;
}
};
```