Pergunta de entrevista da empresa CIBC

Coding interview regarding optimization and space complexity.