Was there a paper you referenced for the algorithm? Or did you come up with it? Just trying to understand it better because the data structure is a bit confusing.
yeah i came up with it but it's trivial, just build a tree, store the first occurrence of each number, if all numbers are found halt