Search
⌘K

Leetcode 2200. Find All K-Distant Indices in an Array

Return all indices i such that there exists an index j with nums[j] == key and |i - j| <= k — equivalently, compute the union of k-radius neighborhoods around each occurrence of key and return those indices in increasing order.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.