Hudson River Trading interview question

4 leetcode medium to hard level question