Company: Booking holdings_9aug
Difficulty: medium
Task Scheduling Problem Description Given an array taskMemory of n positive integers representing memory required for each task, an array taskType of n positive integers representing task types, and an integer maxMemory , find the minimum time required to process all tasks. Each task takes 1 unit of time. The server can process at most two tasks in parallel only if they are the same type and together require no more than maxMemory units. Complete the function getMinTime in the editor with the following parameter(s): int taskMemory[n] : the memory required by the tasks int taskType[n] : the type of the tasks int maxMemory : the maximum total memory that can be allocated to the tasks Returns: int : the minimum time required to process all tasks int getMinTime(std::vector<int> taskMemory, std::vector<int> taskType, int maxMemory) { // Function implementation } Examples Example 1: Input: n = 4, taskMemory = [7, 2, 3, 9], taskType = [1, 2, 1, 3], maxMemory = 10 Output: 3 Explana