Meta Interview Question

I got a question from leetcode, Task Scheduler.