Pergunta de entrevista da empresa Two Sigma

Leetcode mid to hard problems.