Problem Description Link
Algorithm
Algorithm
This is a simple problem this problem you can solve
easily . To solve this problem you must remember 3 conditions.
Garbage truck is
collecting garbage on its route starting at the dump and collecting garbage
from pick up points in order (closest first). Garbage truck returns to the dump
and empties its contents if it either
- is full or
- cannot load the garbage at the current point because it
will put the load over the weight limit (the truck driver has no way of
knowing the weight of the garbage at a particular pick up point until the
truck reaches that point) or
- there are no more pick up points left