1.- Look for the number in the index of the array marked by the current position

2.- If the number is negative it means that it is repeated

```
var findDuplicates = function(nums) {
var res = [],
index,
i;
for(i = 0; i < nums.length; i++){
index = Math.abs(nums[i]) - 1;
if(nums[index] < 0)
res.push(index + 1);
else
nums[index] *= -1;
}
return res;
};
```