Problem 3488 · Medium

Closest Equal Element Queries

Find the nearest equal value around the circle by checking the two neighbours of each query index among equal values.

Open the interactive visualisation