Available question text
Count unordered pairs of points (i<j) whose distance defined as (xi XOR xj) + (yi XOR yj) equals k; with n up to 50k and k ≤ 100, the challenge is to avoid O(n^2) by using frequency maps and combining counts of possible XOR contributions (0..k) for x and y.
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 2857. Count Pairs of Points With Distance k
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source