Available question text
Given an integer array and thresholds k (indexDifference) and t (valueDifference), find any pair of indices i, j with |i−j| ≥ k and |nums[i]−nums[j]| ≥ t, or return [-1,-1] if none exist. The algorithmic challenge is to do this efficiently for n up to 1e5 (e.g., with ordered sets, bucketization, or sorting) rather than brute-force O(n^2).
Related questions
Continue with questions that share topics or the same question type.
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 2905. Find Indices With Index and Value Difference II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source