Collapse repeated heartbeat quotes
A quote feed re-publishes the current top-of-book on a heartbeat, so when nothing changes you receive the identical message many times back to back. You only want to forward a message when it differs from the one immediately preceding it. Note this is not global dedup: a value that returns later, after something else came between, is a real change and must pass through.
stream = ["A", "A", "B", "B", "B", "A", "C", "C"]
-> ["A", "B", "A", "C"]
Remove only consecutive duplicates, preserving order, in extra space.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.