Pergunta de entrevista da empresa Larsen & Toubro

Find the most frequently occurring element in an array. If multiple elements have the same highest frequency, return the smallest element.