Tap here to switch tabs
Problem
Submissions

Problem: Minimum Bit Flips to Convert Number

med
30 min
Try to solve the Minimum Bit Flips to Convert Number problem.

Statement

Given two integers start and goal, determine the minimum number of bit flips needed to transform start into goal.

A bit flip of a number entails changing a single bit in its binary representation from 00 to 11 or from 11 to 00.

Constraints:

  • 0≤0 \leq start, goal ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Bit Flips to Convert Number

med
30 min
Try to solve the Minimum Bit Flips to Convert Number problem.

Statement

Given two integers start and goal, determine the minimum number of bit flips needed to transform start into goal.

A bit flip of a number entails changing a single bit in its binary representation from 00 to 11 or from 11 to 00.

Constraints:

  • 0≤0 \leq start, goal ≤109\leq 10^9