> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0421_maximum_xor_of_two_numbers_in_an_array/slt.md).

# Solution1 位运算 + Trie

* 时间复杂度 O(n \* logc)

  &#x20; n 是 nums 的长度，c 是字典树集合的大小，这里是 2
* 空间复杂度 O(n \* logc)

  &#x20; n 中的每一个数在字典树中都要用 logc 的空间

遍历一遍 nums，利用字典树的特性找到 当前 nums\[i] 与前面所有 \[nums\[0], nums\[i-1]] 异或的最大值
