Optiver interview question

three coding questions. They are at leetcode medium