Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
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.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.