Get Minimum Pen Drive Size

Problem Overview

  • Determine the minimum uniform pen drive capacity to distribute n games to k children so all games are assigned.
  • Input: gameSize array and k; Output: integer minimum capacity.
  • Constraints: 1 ≤ k ≤ n ≤ 2e5, 1 ≤ gameSize[i] ≤ 1e9, n ≤ 2k; each drive holds at most 2 games; each child gets at least one.
  • Real-world context: Amazon Gaming Distribution System logistics.
  • From Amazon 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: