3488. Closest Equal Element Queries
You are given a circular array
numsand an arrayqueries.For each query
i, you have to find the following:
- The minimum distance between the element at index
queries[i]and any other indexjin the circular array, wherenums[j] == nums[queries[i]]. If no such index exists, the answer for that query should be -1.Return an array
answerof the same size asqueries, whereanswer[i]represents the result for queryi.