Array
3740. Minimum Distance Between Three Equal Elements I
Given an array nums. A triple of distinct indices (i,j,k) is "good" if nums[i]==nums[j]==nums[k]. Its "distance" = |i−j|+|j−k|+|k−i|. Find the minimum distance of a good triple, else −1.
Loading…