LeetCode Daily Challenge-2200. Find All K-Distant Indices in an Array
Problem description
A naive method
find all the numbers that has a value of key, save their positions in a list
loop through the list as j
find index i that is not k steps further than j
if there is at least 1 index i that fits the requiremnt, add...
huanganni.hashnode.dev4 min read