Skip to content

Commit a83a8ae

Browse files
committed
update readme
1 parent 9a23684 commit a83a8ae

File tree

6 files changed

+17
-88
lines changed

6 files changed

+17
-88
lines changed

.github/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0339-nested-list-weight-sum python medium
1+
0339-nested-list-weight-sum python medium

1732-minimum-one-bit-operations-to-make-integers-zero/1732-minimum-one-bit-operations-to-make-integers-zero.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

1732-minimum-one-bit-operations-to-make-integers-zero/README.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

Python/1611-minimum-one-bit-operations-to-make-integers-zero.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ class Solution:
44
def minimumOneBitOperations(self, n: int) -> int:
55
if n == 0:
66
return 0
7-
87
k = 0
98
curr = 1
109
while (curr * 2) <= n:
1110
curr *= 2
1211
k += 1
13-
1412
return 2 ** (k + 1) - 1 - self.minimumOneBitOperations(n ^ curr)
1513

1614

1715
n = 3
18-
print(Solution)
16+
print(Solution().minimumOneBitOperations(n))
17+
n = 6
18+
print(Solution().minimumOneBitOperations(n))

README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,3 @@ It helps others discover the repo and keeps the project growing.
115115
---
116116

117117
Feedback / Questions → open an Issue or reach out on [LinkedIn](https://www.linkedin.com/in/hogan-l/)
118-
119-
<!---LeetCode Topics Start-->
120-
# LeetCode Topics
121-
## Dynamic Programming
122-
| |
123-
| ------- |
124-
| [1732-minimum-one-bit-operations-to-make-integers-zero](https://github.com/hogan-tech/leetcode-solution/tree/master/1732-minimum-one-bit-operations-to-make-integers-zero) |
125-
## Bit Manipulation
126-
| |
127-
| ------- |
128-
| [1732-minimum-one-bit-operations-to-make-integers-zero](https://github.com/hogan-tech/leetcode-solution/tree/master/1732-minimum-one-bit-operations-to-make-integers-zero) |
129-
## Memoization
130-
| |
131-
| ------- |
132-
| [1732-minimum-one-bit-operations-to-make-integers-zero](https://github.com/hogan-tech/leetcode-solution/tree/master/1732-minimum-one-bit-operations-to-make-integers-zero) |
133-
<!---LeetCode Topics End-->

Readme/1611-minimum-one-bit-operations-to-make-integers-zero.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2><a href="https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero/">1611. Minimum One Bit Operations to Make Integers Zero</a></h2><h3>Hard</h3><hr><div><p>Given an integer <code>n</code>, you must transform it into <code>0</code> using the following operations any number of times:</p>
1+
<h2><a href="https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero">1732. Minimum One Bit Operations to Make Integers Zero</a></h2><h3>Hard</h3><hr><p>Given an integer <code>n</code>, you must transform it into <code>0</code> using the following operations any number of times:</p>
22

33
<ul>
44
<li>Change the rightmost (<code>0<sup>th</sup></code>) bit in the binary representation of <code>n</code>.</li>
@@ -10,22 +10,24 @@
1010
<p>&nbsp;</p>
1111
<p><strong class="example">Example 1:</strong></p>
1212

13-
<pre><strong>Input:</strong> n = 3
13+
<pre>
14+
<strong>Input:</strong> n = 3
1415
<strong>Output:</strong> 2
15-
<strong>Explanation:</strong> The binary representation of 3 is "11".
16-
"<u>1</u>1" -&gt; "<u>0</u>1" with the 2<sup>nd</sup> operation since the 0<sup>th</sup> bit is 1.
17-
"0<u>1</u>" -&gt; "0<u>0</u>" with the 1<sup>st</sup> operation.
16+
<strong>Explanation:</strong> The binary representation of 3 is &quot;11&quot;.
17+
&quot;<u>1</u>1&quot; -&gt; &quot;<u>0</u>1&quot; with the 2<sup>nd</sup> operation since the 0<sup>th</sup> bit is 1.
18+
&quot;0<u>1</u>&quot; -&gt; &quot;0<u>0</u>&quot; with the 1<sup>st</sup> operation.
1819
</pre>
1920

2021
<p><strong class="example">Example 2:</strong></p>
2122

22-
<pre><strong>Input:</strong> n = 6
23+
<pre>
24+
<strong>Input:</strong> n = 6
2325
<strong>Output:</strong> 4
24-
<strong>Explanation:</strong> The binary representation of 6 is "110".
25-
"<u>1</u>10" -&gt; "<u>0</u>10" with the 2<sup>nd</sup> operation since the 1<sup>st</sup> bit is 1 and 0<sup>th</sup> through 0<sup>th</sup> bits are 0.
26-
"01<u>0</u>" -&gt; "01<u>1</u>" with the 1<sup>st</sup> operation.
27-
"0<u>1</u>1" -&gt; "0<u>0</u>1" with the 2<sup>nd</sup> operation since the 0<sup>th</sup> bit is 1.
28-
"00<u>1</u>" -&gt; "00<u>0</u>" with the 1<sup>st</sup> operation.
26+
<strong>Explanation:</strong> The binary representation of 6 is &quot;110&quot;.
27+
&quot;<u>1</u>10&quot; -&gt; &quot;<u>0</u>10&quot; with the 2<sup>nd</sup> operation since the 1<sup>st</sup> bit is 1 and 0<sup>th</sup> through 0<sup>th</sup> bits are 0.
28+
&quot;01<u>0</u>&quot; -&gt; &quot;01<u>1</u>&quot; with the 1<sup>st</sup> operation.
29+
&quot;0<u>1</u>1&quot; -&gt; &quot;0<u>0</u>1&quot; with the 2<sup>nd</sup> operation since the 0<sup>th</sup> bit is 1.
30+
&quot;00<u>1</u>&quot; -&gt; &quot;00<u>0</u>&quot; with the 1<sup>st</sup> operation.
2931
</pre>
3032

3133
<p>&nbsp;</p>
@@ -34,4 +36,3 @@
3436
<ul>
3537
<li><code>0 &lt;= n &lt;= 10<sup>9</sup></code></li>
3638
</ul>
37-
</div>

0 commit comments

Comments
 (0)