Leetcode 3159. Find Occurrences of an Element in an Array
For each query k, return the index of the k-th occurrence of x in nums (or -1 if fewer than k occurrences exist). Because nums and queries can be large, this is typically solved by preprocessing the list of indices where nums[i]==x to answer each query quickly.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.