Pergunta de entrevista da empresa Squarepoint Capital

Leetcode question, a practical guild to quantitative finance interviews