Pergunta de entrevista da empresa Google

Question related to merging two arrays