Pregunta de entrevista de Amazon

dsa question from array manipulation and set operation