Nearby Values Within Index and Value Distance

Asked at Waymo · Coding Questions · Difficulty: Hard · Last asked May 15, 2026

Given an array of integers, decide whether two different positions hold values that are close to each other and also close in index. This kind of check appears when detecting near-duplicate readings in a stream within a recent window.

Loading the problem…