Problem 1944 · Hard

Number of Visible People in a Queue

Count how many people each person can see to their right, where a taller person blocks those behind them. The visual shows heights as bars with a stack of candidates and arrows to the people each one can see.

Open the interactive visualisation