Optiver Interview Question

Don't remember completely but practice leetcode