Microsoft interview question

task scheduling problem of leetcode