2-Sigma interview question

Typical Leet code coding question