I have an array of integers a = [1, 2, 1, 2, 1 , 3, 4, 5, 6, 7, 1, 2]
Assume that each integer is emitted after a gap of 100ms
How is it possible to make sure that there is a gap of atleast 500ms between same integers being emitted. Ignore the element if same element was emitted less than 500ms ago.
For example: in above case, the result should look like
1,2,3,4,5,7,1,2