Apply both halves of the set/check/clear idiom in sequence: turn set_pos on, then turn clear_pos off, and print
the resulting value of n.
Doing this as two separate statements, in order, is deliberate: it’s what makes the third test case well-defined
when set_pos and clear_pos are the same position – the set happens, and then the clear immediately undoes it,
so the net effect on that bit is nothing. Trying to combine both into one clever expression is more likely to get
that tie-breaking case wrong than doing it in two obvious steps.