Contains Duplicate III

Hard · Binary Search Trees · about 30 minutes

Asked at Google, Amazon, Microsoft, Netflix, Airbnb.

Return true if there are indices i != j with |i - j| <= indexDiff and |nums[i] - nums[j]| <= valueDiff.

Related guides