Contains Duplicate II — JavaScript easy interview problem
Given an integer array `nums` and an integer `k`, return `true` if there are two distinct indices i and j such that `nums[i] === nums[j]` and `abs(i - j) <= k`.
Tags: hashmap, sliding-window
Practice this Arrays problem free in the JS Interview Playground with automated tests and unlockable solutions.