Panda Guru LogoPanda
Guru

Amazon OA | Inventory Management

Round 1

Questions: In the world of Amazon's vast inventory management, you face a challenge of optimizing two inventories, inv1 and inv2, each containing n elements.

Your goal is to maximize the similarity between these inventories. The similarity is measured by the number of indices i (0 ≤ i < n) where inv1[i] equals inv2[i].

Amazon provides a unique tool, the "Inventory Optimizer". This tool allows you to perform the following operation:

  1. Select two distinct indices i and j (where 0 ≤ i, j < n and i ≠ j), provided that the jth element of inv1 is positive.
  2. Apply the operation: add 1 to inv1[i] and subtract 1 from inv1[j].

Using the Inventory Optimizer, you can perform this operation any number of times (including zero) to maximize the similarity between inv1 and inv2.

Constraints:

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.