Problem Statement
Five students P, Q, R, S, T have different heights. P is taller than only one person. R is taller than Q but shorter than S. T is taller than P but shorter than R. Who is the tallest?
Explanation
Translate to chains: R > Q; S > R; T < R and T > P; P > only one person ⇒ P second from bottom. Build from bottom: let the shortest be X, then P just above X. Since T > P, T is above P. And T < R < S. Also R > Q, so Q is below R. A consistent order from top is S > R > T > P > Q (or S > R > T > Q > P if Q shortest), but in all valid orders **S** is topmost.
Code Solution
SolutionRead Only
Chain: S > R > T > P ; and R > Q ⇒ tallest = S
Practice Sets
This question appears in the following practice sets:
