Given an integer array nums, a triplet of indices (i, j, k) is called a good tuple if:
i j k nums.length
nums[i] == nums[j] == nums[k]
The distance of a tuple (i, j, k) is calculated as abs(i - j) + abs(j - k) + abs(k - i).
Return the minimum distance among all possible good tuples. If no good tuple exists, return
Constraints:
n nums.length
nums[i] n
Given an integer array nums, a triplet of indices (i, j, k) is called a good tuple if:
i j k nums.length
nums[i] == nums[j] == nums[k]
The distance of a tuple (i, j, k) is calculated as abs(i - j) + abs(j - k) + abs(k - i).
Return the minimum distance among all possible good tuples. If no good tuple exists, return
Constraints:
n nums.length
nums[i] n