I have a stack with integer values objects. I want to buy a truck with capacity N( N is unknown) to be sure that I can transport all the objects in maximum X laps.
X is known. In other words, I have to partition the stack( the order of objects must be maintained) In maximum X subsets with sum lower than N and find that minimum N.
Can you help me with an algorithm or an idea, please? Thanks.