Skip to content

Commit d46dbd6

Browse files
committed
update readme
1 parent 18255d1 commit d46dbd6

File tree

7 files changed

+7
-222
lines changed

7 files changed

+7
-222
lines changed

0312-burst-balloons/0312-burst-balloons.py

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

0312-burst-balloons/README.md

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

3676-smallest-number-with-all-set-bits/3676-smallest-number-with-all-set-bits.py

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

3676-smallest-number-with-all-set-bits/README.md

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

Python/0312-burst-balloons.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,16 @@ class Solution:
3030
def maxCoins(self, nums: List[int]) -> int:
3131
if len(nums) > 1 and len(set(nums)) == 1:
3232
return (nums[0] ** 3) * (len(nums) - 2) + nums[0] ** 2 + nums[0]
33-
3433
nums = [1] + nums + [1]
3534
n = len(nums)
36-
dp = [[0] * n for _ in range(n)]
37-
35+
dp = [[0 for _ in range(n)] for _ in range(n)]
3836
for left in range(n - 2, 0, -1):
3937
for right in range(left, n - 1):
4038
for i in range(left, right + 1):
4139
gain = nums[left - 1] * nums[i] * nums[right + 1]
4240
remaining = dp[left][i - 1] + dp[i + 1][right]
4341
dp[left][right] = max(remaining + gain, dp[left][right])
42+
4443
return dp[1][n - 2]
4544
'''
4645
1. What is dp_state?

README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +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-
## Math
122-
| |
123-
| ------- |
124-
| [3676-smallest-number-with-all-set-bits](https://github.com/hogan-tech/leetcode-solution/tree/master/3676-smallest-number-with-all-set-bits) |
125-
## Bit Manipulation
126-
| |
127-
| ------- |
128-
| [3676-smallest-number-with-all-set-bits](https://github.com/hogan-tech/leetcode-solution/tree/master/3676-smallest-number-with-all-set-bits) |
129-
## Array
130-
| |
131-
| ------- |
132-
| [0312-burst-balloons](https://github.com/hogan-tech/leetcode-solution/tree/master/0312-burst-balloons) |
133-
## Dynamic Programming
134-
| |
135-
| ------- |
136-
| [0312-burst-balloons](https://github.com/hogan-tech/leetcode-solution/tree/master/0312-burst-balloons) |
137-
<!---LeetCode Topics End-->

Readme/0312-burst-balloons.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2><a href="https://leetcode.com/problems/burst-balloons/">312. Burst Balloons</a></h2><h3>Hard</h3><hr><div><p>You are given <code>n</code> balloons, indexed from <code>0</code> to <code>n - 1</code>. Each balloon is painted with a number on it represented by an array <code>nums</code>. You are asked to burst all the balloons.</p>
1+
<h2><a href="https://leetcode.com/problems/burst-balloons">312. Burst Balloons</a></h2><h3>Hard</h3><hr><p>You are given <code>n</code> balloons, indexed from <code>0</code> to <code>n - 1</code>. Each balloon is painted with a number on it represented by an array <code>nums</code>. You are asked to burst all the balloons.</p>
22

33
<p>If you burst the <code>i<sup>th</sup></code> balloon, you will get <code>nums[i - 1] * nums[i] * nums[i + 1]</code> coins. If <code>i - 1</code> or <code>i + 1</code> goes out of bounds of the array, then treat it as if there is a balloon with a <code>1</code> painted on it.</p>
44

@@ -7,15 +7,17 @@
77
<p>&nbsp;</p>
88
<p><strong class="example">Example 1:</strong></p>
99

10-
<pre><strong>Input:</strong> nums = [3,1,5,8]
10+
<pre>
11+
<strong>Input:</strong> nums = [3,1,5,8]
1112
<strong>Output:</strong> 167
1213
<strong>Explanation:</strong>
1314
nums = [3,1,5,8] --&gt; [3,5,8] --&gt; [3,8] --&gt; [8] --&gt; []
1415
coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167</pre>
1516

1617
<p><strong class="example">Example 2:</strong></p>
1718

18-
<pre><strong>Input:</strong> nums = [1,5]
19+
<pre>
20+
<strong>Input:</strong> nums = [1,5]
1921
<strong>Output:</strong> 10
2022
</pre>
2123

@@ -27,4 +29,3 @@ coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167</pre>
2729
<li><code>1 &lt;= n &lt;= 300</code></li>
2830
<li><code>0 &lt;= nums[i] &lt;= 100</code></li>
2931
</ul>
30-
</div>

0 commit comments

Comments
 (0)