Pergunta de entrevista da empresa IMC Trading

It was a coding question.