Pergunta de entrevista da empresa N26

Time and memory complexity of the algorithm.