Available question text
Count the number of index pairs (i<j) whose XOR falls within [low, high]; the challenge is to do better than O(n^2) by computing, for each element, how many previous elements produce XOR ≤ bound and using a binary trie (bitwise prefix tree) to get an O(n log C) solution (C = max value range).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1803. Count Pairs With XOR in a Range
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source