Input: Given an array of n elements which contains elements from 0 to n-1, with any of these numbers appearing any number of times.
Goal : To find these repeating numbers in O(n) and using only constant memory space.
For example, let n be 7 and array be {1, 2, 3, 1, 3, 0, 6}, the answer should be 1 & 3.
I checked similar questions here but the answers used some data structures like HashSet
etc.
Any efficient algorithm for the same?