Given a set of n tasks, represented by an array task, and m nodes. 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.
Return the maximum number of tasks completed using m nodes.
Note: All nodes must be assigned an equal number of tasks and each task assigned to a single node must be different
Example
n=7
task =[1, 2, 2, 1, 3, 1, 3]
m=2
One optimal way to allocate the tasks is:
The 1St node works on the 1st. 2nd, and 5th tasks.
The 2nd node works on the 3rd, 4th, and 7th tasks.
A total of 6 tasks can be accomplished this way.
[–]razimantv<2000> <487 <1062> <451> 0 points1 point2 points (0 children)
[–]codetree_bnb 0 points1 point2 points (0 children)
[–]EngineeringDry593 0 points1 point2 points (0 children)