Pregunta de entrevista de CIBC

Coding interview regarding optimization and space complexity.