Skip to main content
PreparationZone Logo
PreparationZone
Back to Coding

Coding · Hard · Pro

Maximum XOR of two numbers in an array

CodingBit ManipulationStaff
Model answerPreview

Approach

  • Build binary trie of prefixes for max XOR walk.
  • For each number, greedily pick opposite bit when possible.

Java Solution