Maximum Genetic Difference Query

You are given a list of operations queries, where each entry is a string of the form "t v" with two whitespace separated tokens:

  • "1 v" inserts the value v into a multiset.
  • "2 v" deletes one occurrence of v from the multiset. Deleting a value that is not present is a no-op.
  • "3 v" queries the maximum value of v XOR x over every x currently in the multiset. If the multiset is empty, the query reports 0.

Return the maximum value reported by any "3" operation. If there are no "3" operations, return 0.

Examples
Input: []
Output: 0
Hints

Maximum Genetic Difference Query

You are given a list of operations `queries`, where each entry is a string of the form `"t v"` with two whitespace separated tokens: