Hudson River Trading interview question

Leetcode easy and medium on CodeSignal