Optiver interview question

3 leetcode type questions were given