Minimum Flips to Make a OR b Equal to c

Medium · Bit Manipulation · about 15 minutes

Asked at Microsoft, Amazon, Google.

Given positive integers a, b and c, return the minimum number of single-bit flips in a and b so that a OR b == c.