Pergunta de entrevista da empresa Iunigo

how to remove duplicated item from an array, how to flatten an array