Amazon·Software Engineer·Online Assessment (OA)
- You have n warehouses arranged in a circle, each holding some number of products. Moving one product across a single edge costs 1, but all moves must flow in one fixed direction around the ring (no mixing clockwise and counterclockwise). Given that the total is divisible by n, find the minimum cost to equalize all positions.
“The directional constraint is what makes this hard.”