Skip to content

Commit 7fec372

Browse files
Create README - LeetHub
1 parent 6886b79 commit 7fec372

File tree

1 file changed

+35
-0
lines changed
  • 1441-minimum-flips-to-make-a-or-b-equal-to-c

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<h2><a href="https://leetcode.com/problems/minimum-flips-to-make-a-or-b-equal-to-c">1441. Minimum Flips to Make a OR b Equal to c</a></h2><h3>Medium</h3><hr><p>Given 3 positives numbers <code>a</code>, <code>b</code> and <code>c</code>. Return the minimum flips required in some bits of <code>a</code> and <code>b</code> to make (&nbsp;<code>a</code> OR <code>b</code> == <code>c</code>&nbsp;). (bitwise OR operation).<br />
2+
Flip operation&nbsp;consists of change&nbsp;<strong>any</strong>&nbsp;single bit 1 to 0 or change the bit 0 to 1&nbsp;in their binary representation.</p>
3+
4+
<p>&nbsp;</p>
5+
<p><strong class="example">Example 1:</strong></p>
6+
7+
<p><img alt="" src="https://assets.leetcode.com/uploads/2020/01/06/sample_3_1676.png" style="width: 260px; height: 87px;" /></p>
8+
9+
<pre>
10+
<strong>Input:</strong> a = 2, b = 6, c = 5
11+
<strong>Output:</strong> 3
12+
<strong>Explanation: </strong>After flips a = 1 , b = 4 , c = 5 such that (<code>a</code> OR <code>b</code> == <code>c</code>)</pre>
13+
14+
<p><strong class="example">Example 2:</strong></p>
15+
16+
<pre>
17+
<strong>Input:</strong> a = 4, b = 2, c = 7
18+
<strong>Output:</strong> 1
19+
</pre>
20+
21+
<p><strong class="example">Example 3:</strong></p>
22+
23+
<pre>
24+
<strong>Input:</strong> a = 1, b = 2, c = 3
25+
<strong>Output:</strong> 0
26+
</pre>
27+
28+
<p>&nbsp;</p>
29+
<p><strong>Constraints:</strong></p>
30+
31+
<ul>
32+
<li><code>1 &lt;= a &lt;= 10^9</code></li>
33+
<li><code>1 &lt;= b&nbsp;&lt;= 10^9</code></li>
34+
<li><code>1 &lt;= c&nbsp;&lt;= 10^9</code></li>
35+
</ul>

0 commit comments

Comments
 (0)