Explanation:
to solve for r means we want to get the equation in a form
r = ...
or
... = r
s = t - q + r
remember, when we apply a change, we need to do it on both sides of the equation.
so, we need to get rid of these extra terms on the side of r.
let's start by subtracting t everywhere :
s - t = t - q + r - t
s - t = -q + r = r - q
so, to get rid of q on the r side, we add q everywhere :
s - t + q = r
bingo !