Freshworks interview question

remove duplicate of the array inplace (without using extra memory)