Domanda di colloquio di Meta

I got a question from leetcode, Task Scheduler.