A cloud provider needs to schedule a new computing task on one of its available server hubs. Your goal is to design an algorithm that selects the most efficient hub for the job based on capacity and availability.
You are given n hubs, indexed from 0 to n - 1. You are provided with the following information:
- An integer array
capacitiesof lengthn, wherecapacities[i]is the total processing capacity of hubi. - A 2D array of strings
intervals, whereintervals[i]contains a list of strings representing time intervals already booked on hubi. Each interval is a string in the format"start:end", indicating a booking fromstarttoend(inclusive). - An integer
requiredCapacity, which is the processing capacity needed for the new task. - A string
taskIntervalin the format"start:end", representing the start and end time for the new task, inclusive.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected