Pergunta de entrevista da empresa Meta

Coding question: scheduling problem, and the order is fixed. And calculate the minimum time cost to finish those tasks.