Company: UKG
Difficulty: medium
Neural Task Allocation Given a compiled set of n tasks, represented by an array task, and a neural network system with m nodes, each processes tasks efficiently. For optimal performance, tasks must be distributed evenly across these nodes, i.e., all nodes should serve the same number of tasks. Each task assigned to a single node must be different. Maximize the number of tasks completed by allocating tasks effectively within the neural network and return the maximum number of tasks completed using the distributed neural network system. Note: All nodes must be assigned an equal number of tasks. Function Description Complete the function findMaximumTasks with the following parameters: int task[n] : the type of each task int m : the number of nodes in the neural network system Returns int : the maximum number of tasks that can be completed by distributing tasks optimally Constraints 1 ≤ n ≤ 3 × 10⁵ 1 ≤ task[i] ≤ 10⁹ 1 ≤ m ≤ 10⁹ Example Given: n = 7 task = [1, 2, 2, 1, 3, 1, 3] m = 2 One op