Problem 4048 · Medium
Gather each value’s indices; a value with exactly three hits counts when its two gaps match.
Open the interactive visualisation