Problem 3159 · Medium

Find Occurrences of an Element in an Array

Record the positions of x in order, then answer each query with the position of its occurrence number.

Open the interactive visualisation