Get Max Efficiency

Problem Overview

  • Partition n servers into exactly k upgrade batches with fixed sizes to maximize total efficiency, where each batch’s efficiency is max(capacity) − min(capacity).
  • Input: capacity[n] and numServers[k]; each server used exactly once; sum of numServers equals n.
  • Output: a long integer for the maximum possible sum of batch efficiencies.
  • Context: server upgrade planning and allocation optimization in IT operations.
  • Company: asked in Salesforce interviews; a coding interview problem and 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: