Problem 3761 · Medium

Minimum Absolute Distance Between Mirror Pairs

Scan left to right and remember the latest index for each reversed value, so each mirror match gives its closest gap.

Open the interactive visualisation