Halodoc Interview Question

Finding frequency and performing some operations on an array