Search
⌘K
Leetcode 219. Contains Duplicate II
Determine whether the array contains two equal elements whose indices differ by at most k — i.e., detect duplicates within a sliding window of size k+1 (array length up to 1e5, so an O(n) lookup-based approach is expected).
Asked at:
Meta
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early January, 2026
Meta
Mid-level
Late July, 2025
Meta
Senior
Asked as it appears on LC
Mid March, 2025
Amazon
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.