Pregunta de entrevista de Palo Alto Networks

leetcode medium based array question