Count pairs satisfying sum and bitwise AND equations
Filed under Uber
The question
Given an integer w, find the number of pairs of integers (a, b) that satisfy the equations w + a = b and a AND b = 0, assuming no overflows.
No write-up yet. Related questions below have one.
Related Uber questions
Collected from public candidate posts and coding forums. Updated Nov 2026.