Pregunta de entrevista de Presidio

Time complexity of the given c++ code snippet