Take away right after the end.
transcript
One update, two writes. Where does the minus go? A shift adds a count over a range. It writes only two notes. Right after the end.
Entry i is the difference from place i minus one. A running total gives the value. So add at left, and take away at right plus one. The list has one extra entry. An update at the last place needs it. Each update costs two writes.
Add four to places two to six. Write plus four at place two. Write minus four at place seven. Place six still holds the four. Place seven does not.
Take away at place six instead. Place six loses the four. The last place of the range is wrong. Use right plus one. Then the whole range stays covered.
Make a change list one longer. Add at left, take away at right plus one. Walk it with a running total. Each total is the value at that place.
Take away right after the end. Full breakdown in the lecture.