Available question text
Given an array and integers indexDiff and valueDiff, determine whether there exist distinct indices i and j with |i - j| ≤ indexDiff and |nums[i] - nums[j]| ≤ valueDiff. The core challenge is maintaining a sliding window of the last indexDiff values and quickly detecting any value within valueDiff of the current element (often solved using an ordered set or bucketization).
Related questions
Continue with questions that share topics or the same question type.
- Contains Duplicate
Coding · Array · Hash Table · Sorting
- Contains Duplicate II
Coding
- Alternating Groups III
Coding
- Basic Calculator III
Coding · Math · Recursion · Stack
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 220. Contains Duplicate III
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source