INTERGRAPH (HEXAGON) | Off Campus OA (2023) | Minimum Flips to Make OR Equal to Goal
Question · Posted Jun 2026
Problem Statement You are given three positive integers a, b, and c. In one operation, you can flip any single bit in the binary representation of either a or b (change 0 to 1 or 1 to 0). Your task is to determine the minimum number of bit flips required so that: (a OR b) = c where OR represents the bitwise OR operation. Return the minimum number of flips needed. Constraints 1 <= a, b, c <= 10^9 Example ...
The full answer & interview discussion are available to premium members.
Log in Create a free account