Two Sigma interview question

Some "HARD" labeled algorithm questions on LeetCode