Two Sigma Interview Question

Leetcode mid to hard problems.