Do not remove the duplicates

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.

1 Like

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.

Click here to start solving coding interview questions