Pregunta de entrevista de Amazon

Basic C code algorithm, need to write it down, not typing