Skip to main content

Practice · 3 of 3

Signal Pairing

CHALLENGE
Difficulty: advanced+25 XP

**Problem.** Given n device ids, print the maximum value of a[i] xor a[j] over all pairs i < j. **Constraints:** 1 <= n <= 200000; 0 <= a[i] < 2^30. The all-pairs scan is the classic near-miss.

Back to lesson: Practice: Mixed Drill — Trees and Strings