1. Tries and XOR #

Created Monday 27 July 2020

Return maximum bitwise XOR pair possible with the query. Here we have 7 - 111 and 1 - 001 i.e 110 is the max. O(n^2^) - naive possible.

But it can be done in nlog(max) using trie.


Code: 10 minutes. Make a node. Has no value, we just want to represent the bit. ./code/trieMaxXOR.cpp