Pregunta de entrevista de Bank of America

Very simple algorithm questions