I need a data structure to keep count of elements and then retrieve elements within a certain range of counts.
Example:
counter = RangeCounter()
for el in [1, 1, 2, 2, 2, 0]
counter.add(el)
counter.get(occurence >= 1 and occurence <= 2)
>>> 1, 2 (element 1 is encountered 2 times)
>>> 2, 3 (element 2 in encountered 3 times)