Skip to content

Commit 2219392

Browse files
committed
Create README - LeetHub
1 parent 263bab8 commit 2219392

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2><a href="https://leetcode.com/problems/largest-perimeter-triangle">976. Largest Perimeter Triangle</a></h2><h3>Easy</h3><hr><p>Given an integer array <code>nums</code>, return <em>the largest perimeter of a triangle with a non-zero area, formed from three of these lengths</em>. If it is impossible to form any triangle of a non-zero area, return <code>0</code>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong class="example">Example 1:</strong></p>
5+
6+
<pre>
7+
<strong>Input:</strong> nums = [2,1,2]
8+
<strong>Output:</strong> 5
9+
<strong>Explanation:</strong> You can form a triangle with three side lengths: 1, 2, and 2.
10+
</pre>
11+
12+
<p><strong class="example">Example 2:</strong></p>
13+
14+
<pre>
15+
<strong>Input:</strong> nums = [1,2,1,10]
16+
<strong>Output:</strong> 0
17+
<strong>Explanation:</strong>
18+
You cannot use the side lengths 1, 1, and 2 to form a triangle.
19+
You cannot use the side lengths 1, 1, and 10 to form a triangle.
20+
You cannot use the side lengths 1, 2, and 10 to form a triangle.
21+
As we cannot use any three side lengths to form a triangle of non-zero area, we return 0.
22+
</pre>
23+
24+
<p>&nbsp;</p>
25+
<p><strong>Constraints:</strong></p>
26+
27+
<ul>
28+
<li><code>3 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
29+
<li><code>1 &lt;= nums[i] &lt;= 10<sup>6</sup></code></li>
30+
</ul>

0 commit comments

Comments
 (0)