Pack Items

Problem Overview

  • Partition item weights into two disjoint subsets A and B covering all items; choose A with minimal size such that sum(A) > sum(B).
  • Input: int[] arr of item weights. Output: int[] of weights in subset A. Constraints not specified.
  • Real-world domain: packing items into two boxes in an Amazon fulfillment context.
  • 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: