codingpracticequestions
What invariant should stay true in this loop?
Anonymous
Before changing a loop, write one sentence describing what must be true at its start or end. After each update, check that the sentence still holds. This often makes off-by-one bugs easier to spot. What invariant do you reach for most often?
0