Pergunta de entrevista da empresa Google

DSA questions on loops was difficult to solve