Solution: Schedule Tasks on Minimum Machines
Let’s solve the Schedule Tasks on Minimum Machines problem using the Heaps pattern.
Statement
We are given an input array, tasks
, where tasks[i]
A machine can execute only one task at a time.
A machine can begin executing a new task immediately after completing the previous one.
An unlimited number of machines are available.
Find the minimum number of machines required to complete these
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.