Pergunta de entrevista da empresa Atlassian

Find the highest possible way one can pair the duplicates of an array