Find Minimum Cost
Amazon's warehouse management team is planning to roll out certain standards and checks that every Amazon Warehouse Manager will follow. Some products may need to be moved initially from one warehouse to another so that each warehouse complies.
A warehouse stores n identical containers arranged in the form of a circle. The distance between two adjacent containers is 1. Each container in a warehouse should hold the same number of products. Plan the optimal set of movements under the following rules.
Find the minimum cost such that finally, every container has the same number of products.
Note: In the examples, positions are one-indexed. It is guaranteed that it is always possible to distribute the products equally.
πβπ© Say TYVM to πspikeπ for the 1000 times! π
1Example 1

Constraints
Limits and guarantees your solution can rely on.
πΊπΊ