Saved Bookmarks
| 1. |
We have N number of orphans in an orphanage. Initially, each orphan has some or no books with them and they are standing in a line.Given an integer array representing B, the number of books with each orphan from left to right on the line, you should find the minimum number of moves to make all the orphans havethe same number of books.If it is not possible to make same number of books with the orphans, then give the output asFor each move, you could choose any orphan and pass one book of each orphan to one of his/her adjacent orphan at the same time.Input Format:The first line contains an integer N (number of orphans).The next line contains N space separated integers of an array.Constraint:1 |
|
Answer» sorry i didn't UNDERSTAND can u put SCREENSHOT so that i may CLEARLY understand PLS.. |
|