The total is not enough
transcript
Here is a shortcut. Add up all the gains. If the total is not negative, start at hut zero. Many people try it first. A small example breaks it. It sounds right. It is not.
Two huts. The gains are minus one and one. The total is zero. The shortcut says start at hut zero. The huts form a circle. The bottle starts empty. Water is never added from outside.
From hut zero, the bottle is minus one. That is below zero. The start fails. From hut one, the bottle is one, then zero. Hut one works. The total hides the order. Order is what the bottle tracks.
Keep a bottle and a total. Restart when the bottle fails. The total only decides yes or no. The total decides if any start exists. The bottle finds the start. Use both numbers together.
The total says if a start exists. The bottle says which one. Full breakdown in the lecture.