Check whether an array has equal values at most k indices apart
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Other
Overview: Given an integer array and an integer k, decide whether two different indices hold the same value and sit at most k positions apart. It tests sliding window reasoning, fast membership lookups, and careful handling of the window bounds and off-by-one cases.