Had the same idea, implemented in Java. So far the passed all the test cases. I think one advantage of this approach is that it essentially can ** find all elements that appeared exactly/at least i times** for any i with O(1) space and O(N) time. Although the division and modulling operation actually take more time than negating. Here is my java code just for reference:

public class Solution {
public List<Integer> findDuplicates(int[] nums) {
int n = nums.length;
for (int i = 0; i < n; i++) {
nums[nums[i] % (n + 1) - 1] += n + 1;
}
List<Integer> res = new ArrayList<>();
for (int i = 0; i < n; i++) {
if (nums[i] / (n + 1) == 2)
res.add(i + 1);
}
return res;
}
}