Pergunta de entrevista da empresa IMC Trading

2 leetcode medium problems, a little time crunch