← ALL NOTES
Array

3741. Minimum Distance Between Three Equal Elements II

Same as "Minimum Distance Between Three Equal Elements I," but version II (larger input): a triple of distinct indices with equal values, distance |i−j|+|j−k|+|k−i|; find the minimum, else −1.

Loading…