Company: Deutsche bank_7aug
Difficulty: medium
Task Scheduler with Dependency Constraints Problem Description You are designing a multi-threaded task scheduler that executes tasks with dependency constraints. There are N tasks numbered from 0 to N-1. Some tasks depend on other tasks, meaning a task can only start execution after all its dependencies have completed. Your scheduler runs on M worker threads and should schedule tasks such that: No task starts before all its dependencies are completed. At most M tasks can be running concurrently. Tasks run instantaneously for this problem (no actual execution time simulation required). Your goal is to compute the minimum number of time units (ticks) needed to complete all tasks, where in each tick, any number of eligible tasks can run concurrently up to M. Function Description: Implement the function minTimeToCompleteTasks which, given the number of tasks, the number of worker threads, the number of dependencies, and the dependency list, returns the minimum time units required to comple