Anyone can help me proceed with this question? I am not able to figure out how to do it. I can do it for the case when all the boxes are smaller than all the trucks.
> I can do it for the case when all the boxes are smaller than all the trucks.
So what happens when you have exactly 1 box in all your boxes which is larger than the capacity of the smallest truck?
Create a very small test case, say 2 trucks and 3 boxes, where the larger truck is the one which has to make the 2nd trip, and follow what happens in your code.
Being able to analyse what happens on the edge cases is where you learn how to solve the problem completely.