Schedule Batch Difference
Problem Overview
- Task: Partition n servers into k batches per numServers; for each batch, take (max capacity - min capacity); return the sum.
- Input: n, capacities[n], k, numServers[k] where numServers[i] is servers in batch i. Output: single integer total difference.
- Constraints: sum(numServers) = n, n ≤ 1e6, k ≤ n.
- Context: Server capacity planning and scheduling.
- Source: Salesforce coding interview problem; common interview question.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
