Problem 1707 · Hard

Maximum XOR With an Element From Array

Insert the numbers into a binary trie that stores the smallest value under each node, so a query can skip every branch whose values exceed its limit.

Open the interactive visualisation