What is the best approach to find all duplicate elements in an array of integers in O(n) time and O(1) extra space?