Search
⌘K

Leetcode 3488. Closest Equal Element Queries

Given a circular array and multiple queries, for each query return the minimum circular distance from the queried index to any other index with the same value (or -1 if none exists). This requires grouping indices by value and computing the nearest neighbor distance for each query while accounting for wrap-around.


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.