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.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected