Two Sigma interview question

Leetcode medium and hard level questions