Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Where can we save time? By not visiting all the houses.
For each type of garbage, find the house with the highest index that has at least 1 unit of this type of garbage.