Jane Street interview question

Just one LeetCode Easy/Medium problem