Skip to content

Commit 5f567ee

Browse files
committed
Create README - LeetHub
1 parent d4cde87 commit 5f567ee

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

0312-burst-balloons/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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>
2+
3+
<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>
4+
5+
<p>Return <em>the maximum coins you can collect by bursting the balloons wisely</em>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> nums = [3,1,5,8]
12+
<strong>Output:</strong> 167
13+
<strong>Explanation:</strong>
14+
nums = [3,1,5,8] --&gt; [3,5,8] --&gt; [3,8] --&gt; [8] --&gt; []
15+
coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167</pre>
16+
17+
<p><strong class="example">Example 2:</strong></p>
18+
19+
<pre>
20+
<strong>Input:</strong> nums = [1,5]
21+
<strong>Output:</strong> 10
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li><code>n == nums.length</code></li>
29+
<li><code>1 &lt;= n &lt;= 300</code></li>
30+
<li><code>0 &lt;= nums[i] &lt;= 100</code></li>
31+
</ul>

0 commit comments

Comments
 (0)