Logic Question Suppose we are packaging bananas. We want a…
Logic Question Suppose we are packaging bananas. We want a goal of goal bananas in a bag. We have small bunches 1 banana and large bunches 5 bananas return the number of bags that can be made of goal bananas, assuming we always use the large bunches first. If impossible, return -1 public int bagBanannas(int smallBunch, intLargeBunch, int goal) {// Your code goes here}example output: bagBananas(4, 1, 9) => 4 bagBananas (4, 1, 10) => -1 bagBananas(1, 1, 6) => 1
Read Details