Domanda di colloquio di Optiver

three coding questions. They are at leetcode medium