NewThe Learning module is now liveSee what's new

A distributed system has m processing nodes and an integer array task, where task[i] identifies the type of the ith task. Equal values represent separate tasks of the same type.

Assign a subset of the tasks to the nodes while following these rules:

  • Every node receives the same number of tasks.
  • A node receives at most one task of each type.
  • Each task instance is assigned to at most one node.
Test Cases
Input
Output
Expected