Pergunta de entrevista da empresa BNY

Make sure to know time and space complexity