Equalize the array

Правка en1, от redcoder23, 2020-07-30 11:19:56

You have N candies distributed unevenly in N containers. You can move one candy from a container to an adjacent container. You have to make moves such that finally each container has one candy. What is the strategy that minimizes the number of moves to keep the time complexity O(N)?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский redcoder23 2020-07-30 11:19:56 301 Initial revision (published)