Pergunta de entrevista da empresa IMC Trading

One Leetcode question with some changes, the other one is unseen before.