The question should be re-framed. We only need to find the number of unique elements and place them in the front. Do not remove the duplicates.
Thanks for the clarification brother!
True indeed, misleading question description.
thanks bro, i was stuck
Don’t mislead people.
It is possible to remove the duplicates in O(n) time and without using extra space.