Halloween Sale
Unlock all premium questions for over 30% off
Minimum Warehouse Redistribution Cost
Medium
Question
There are n warehouses placed around a circle and numbered 0 through n - 1. Going clockwise, warehouse i is linked to warehouse (i + 1) % n. At the start, warehouse i stores products[i] units, and the total number of units is guaranteed to be a multiple of n. The aim is to even out the stock so that all warehouses finish with equal unit counts.
...
Asked at:Amazon
More Amazon interview questions
- Maximum Consecutive ON Servershard
- Assign Books To Shelvesmedium
- Compress Nodes In N-ary Treemedium
- Frequent Events Within 24 Hoursmedium
- Find Smallest Available Hubmedium
- Assemble String From Blocksmedium
- All String Reorganizationseasy
- Find Oldest One-Time Visitormedium
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.