This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingCount pairs below each bound with subtree sizes, then subtract.
What this asks
Count pairs whose XOR falls inside a given range.
Count pairs below each bound using a bitwise trie that tracks subtree sizes, then subtract the two counts.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing