Pregunta de entrevista de Freshworks

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