SingleStore interview question

Find duplicates in an array in O(n) time using O(1) memory