2817. Minimum Absolute Difference Between Elements With Constraint
You are given a 0-indexed integer array
numsand an integerx.Find the minimum absolute difference between two elements in the array that are at least
xindices apart.In other words, find two indices
iandjsuch thatabs(i - j) >= xandabs(nums[i] - nums[j])is minimized.Return an integer denoting the minimum absolute difference between two elements that are at least
xindices apart.
1 | class Solution { |