Pergunta de entrevista da empresa Finoit

Find maximum occurring elements in a sorted and unsorted array using single loop and some constraints