Pregunta de entrevista de Meta

I got a question from leetcode, Task Scheduler.