The scores that tie
transcript
Count three posts that fall in score. For each middle post, count both sides. Multiply the two counts. It looks right. Does it hold?
Take three posts with the same score. Look at the middle post. One post before, one after.
Greater or equal counts the post before. Lower or equal counts the post after. One times one makes one slide. That is wrong.
The scores never fall at all. So there is no slide here. Equal is not higher than equal. Compare strictly, on both sides.
Count earlier posts strictly greater. Count later posts strictly less. Equal scores count for neither side. Now the count is right.
Test a list of equal scores first. Test a strictly falling list next. Test a mix of both after that.
Ties hide in small tests. Random values rarely repeat. So always test equal values. Then compare strictly. Full breakdown in the lecture.