Pergunta de entrevista da empresa Google

a memory and complexity coding problem