How can we find the duplicate elements in an array with the following limitations:
Without using extra memory
Can use variables for storing data and not objects like HashMap/HashSet and all.
Time complexity can be O(n) and should not be O(n^2)
Note :
Here array is dynamic integer array.