Domanda di colloquio di Amazon

dsa question from array manipulation and set operation