Pergunta de entrevista da empresa HCLTech

Array Problem to get addition and count of duplicate