Problem 2940 · Hard

Find Building Where Alice and Bob Can Meet

For each pair of query positions, find the leftmost building where both can meet by moving right to a taller building. The visual places query markers on the height bars and shows the candidate building for each pair.

Open the interactive visualisation