Bit Difference Problem

Bit Difference Problem — ExecCode Easy DSA Practice

Solve the Bit Difference problem on ExecCode. Free online easy DSA practice in Bit Manipulation. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Bit Difference. Your task is to compute the required answer and return Hamming distance (integer). Numbers are being inspected at the bit level. In Bit Difference, the answer depends on how binary representation changes the result. a, b: two integers.

Examples

Input {"a": 10, "b": 20}; Output 4. Input {"a": 7, "b": 2}; Output 2. Input {"a": 0, "b": 0}; Output 0

Constraints

0 <= a, b < 2^31

Practice Bit Difference free on ExecCode. Browse DSA problems, topic map, and placement guides.