Dsa
Bit Manipulation
Medium
Flipping Bit Counter
Given two integers A and B, count the number of bits that need to be flipped to convert A into B. Print the count of bits.
Input:
Two integers A and B, separated by a space.
Output:
An integer representing the number of bits to flip.
Example:
Input:
29 15
Output:
2
Key concepts
bit_manipulationflipping
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now