Squarepoint Capital Interview Question

Leetcode question, a practical guild to quantitative finance interviews