Pregunta de entrevista de Halodoc

Finding frequency and performing some operations on an array