Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit 9c555c5

Browse files
committed
added problem69
1 parent 4504193 commit 9c555c5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

problem69/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 1318. Minimum Flips to Make a OR b Equal to c
2+
3+
Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation).
4+
Flip operation consists of change any single bit 1 to 0 or change the bit 0 to 1 in their binary representation.
5+
6+
7+
## Example 1:
8+
9+
Input: a = 2, b = 6, c = 5
10+
Output: 3
11+
Explanation: After flips a = 1 , b = 4 , c = 5 such that (a OR b == c)
12+
13+
## Example 2:
14+
15+
Input: a = 4, b = 2, c = 7
16+
Output: 1
17+
18+
## Example 3:
19+
20+
Input: a = 1, b = 2, c = 3
21+
Output: 0
22+
23+
24+
## Constraints:
25+
26+
1 <= a <= 10^9
27+
1 <= b <= 10^9
28+
1 <= c <= 10^9

0 commit comments

Comments
 (0)