Jack and Jill were passing through a jungle on there way. They encountered a monster who told
Question:
Jack and Jill were passing through a jungle on there way. They encountered a monster who told they will be only be allowed to escape when they solve a puzzle for him. They didn't have choice so agreed.
Given N number of empty buckets, we need to minimize steps to fill required number of fruits in each bucket. Only below mentioned operations are allowed to add fruits.
1. Double the count of fruits - All buckets will double the number of fruits in single operation.
2. Increment individual bucket fruit count by 1.Single operation for each bucket
3. We cannot remove/decrease number of fruits in a bucket.
CONSTRAINTS:
1<=target[i]<=1000, where target[i] is the element at indexY.
1<=i<= 1000
Microbiology A Human Perspective
ISBN: 978-0073375311
7th edition
Authors: Eugene Nester, Denise Anderson, Evans Roberts