Explanation
Stack of 5 slots, 1 at the bottom
Draw five slots, one at the bottom. Box puzzles are floor puzzles in disguise.
Stack of 5 slots, 1 at the bottom
Q at the top (5)
Q is at the top: slot five.
Q at the top (5)
P not 1 or 2
P is not first or second from the bottom, so P is three or four. R sits just above P, and five is taken, so P is three and R is four.
P not 1 or 2; R just above P → P = 3, R = 4
T immediately above S
T is immediately above S. Only slots one and two are left, so S is one and T is two.
T immediately above S → S = 1, T = 2
Final stack
From the bottom: S, T, P, R, Q.
Final stack: S, T, P, R, Q
Worked example
In the stack S, T, P, R, Q (bottom to top), how many boxes are between T and Q? P and R → 2.