OR-Set CRDT replica merge
Your task
An Observed-Remove Set (OR-Set) is a CRDT for a set that supports concurrent adds and removes without coordination. Each add of an element attaches a unique tag; a remove only retires the tags it has actually observed. Each replica state is a dict {"adds": [[elem, tag], ...], "removes": [tag, ...]}. To merge a list of replica states you union all (elem, tag) add-pairs and union all removed tags; an element is PRESENT in the merged set iff it has at least one add-tag that is not in the removed-tag set. Return the sorted list of present elements. This 'add-wins' rule is what lets a concurrent add survive a remove that never saw it.
Examples
orset_merge(replicas: list[dict]) -> list[str]Example 1
Input
orset_merge([{"adds": [["x", "t1"], ["y", "t2"]], "removes": ["t1"]}, {"adds": [["x", "t3"]], "removes": []}])Output
["x", "y"]