Deterministically (left to right) remove duplicate tags