Pregunta de entrevista de Block Gemini

Problem - pyramid pattern(stupid question to a senior developer), find the max occurrence of num in the array.