Pergunta de entrevista da empresa u2i

Reimplement piece of your code with different time complexity