Pregunta de entrevista de Intuit

Time and space complexity of code written