This question evaluates logical reasoning about information constraints, group strategy design, and combinatorial encoding in the Coding & Algorithms domain, with a level of abstraction that emphasizes conceptual understanding alongside practical algorithmic reasoning.
There are N people standing in a line. Each person wears a hat that is either Red or Blue.
i
can
see the hats
of people in front of them (people with index
> i
).
1
) to the front (person
N
), each person must
say out loud
either
Red
or
Blue
as their guess of their own hat color.
N >= 1
.