Pergunta de entrevista da empresa Amazon

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