GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesMax XOR Pair

Gamified challenge · Binary trie

Max XOR Pair

A miner's pouch holds crystals with non-negative charges nums[i] (each below 2^31). Fusing two different crystals releases nums[i] XOR nums[j] energy (two crystals may carry the same charge).

Write maxXor(nums) (Python: max_xor(nums)) that returns the largest energy any pair can release. With fewer than two crystals, return 0.

Example: for [6, 13, 9, 4, 1], 13 XOR 1 = 1101 XOR 0001 = 1100 = 12, but 6 XOR 9 = 0110 XOR 1001 = 1111 = 15 is the biggest blast, so the answer is 15.

Sign in to play Max XOR Pair

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account