Pergunta de entrevista da empresa VK

Some questions about complexity of algorithms, 3 problems in Python