Pregunta de entrevista de Oscar Health

An array question. and the time complexity