Problem 3696 · Medium

Maximum Distance Between Unequal Words in Array I

Find the widest index gap between two unequal words by anchoring two scans at the first and last words.

Open the interactive visualisation