3159. Find Occurrences of an Element in an Array
You are given an integer array
nums, an integer arrayqueries, and an integerx.For each
queries[i], you need to find the index of thequeries[i]thoccurrence ofxin thenumsarray. If there are fewer thanqueries[i]occurrences ofx, the answer should be -1 for that query.Return an integer array
answercontaining the answers to all queries.
1 | class Solution { |