Skip to content

Commit f3b0150

Browse files
committed
Create README - LeetHub
1 parent 02026eb commit f3b0150

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<h2><a href="https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array/"><div id="big-omega-company-tags"><div id="big-omega-topbar"><div class="companyTagsContainer" style="overflow-x: scroll; flex-wrap: nowrap;"><div class="companyTagsContainer--tag" style="background-color: rgba(0, 10, 32, 0.05);"><div>Yahoo</div><div class="companyTagsContainer--tagOccurence">2</div></div><div class="companyTagsContainer--tag" style="background-color: rgba(0, 10, 32, 0.05);"><div>Facebook</div><div class="companyTagsContainer--tagOccurence">2</div></div><div class="companyTagsContainer--tag" style="background-color: rgba(0, 10, 32, 0.05);"><div>Samsung</div><div class="companyTagsContainer--tagOccurence">1</div></div></div><div class="companyTagsContainer--chevron"><div><svg version="1.1" id="icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" fill="#4087F1" xml:space="preserve" style="width: 20px;"><polygon points="16,22 6,12 7.4,10.6 16,19.2 24.6,10.6 26,12 "></polygon><rect id="_x3C_Transparent_Rectangle_x3E_" class="st0" fill="none" width="32" height="32"></rect></svg></div></div></div></div>1464. Maximum Product of Two Elements in an Array</a></h2><h3>Easy</h3><hr><div>Given the array of integers <code>nums</code>, you will choose two different indices <code>i</code> and <code>j</code> of that array. <em>Return the maximum value of</em> <code>(nums[i]-1)*(nums[j]-1)</code>.
2+
<p>&nbsp;</p>
3+
<p><strong class="example">Example 1:</strong></p>
4+
5+
<pre><strong>Input:</strong> nums = [3,4,5,2]
6+
<strong>Output:</strong> 12
7+
<strong>Explanation:</strong> If you choose the indices i=1 and j=2 (indexed from 0), you will get the maximum value, that is, (nums[1]-1)*(nums[2]-1) = (4-1)*(5-1) = 3*4 = 12.
8+
</pre>
9+
10+
<p><strong class="example">Example 2:</strong></p>
11+
12+
<pre><strong>Input:</strong> nums = [1,5,4,5]
13+
<strong>Output:</strong> 16
14+
<strong>Explanation:</strong> Choosing the indices i=1 and j=3 (indexed from 0), you will get the maximum value of (5-1)*(5-1) = 16.
15+
</pre>
16+
17+
<p><strong class="example">Example 3:</strong></p>
18+
19+
<pre><strong>Input:</strong> nums = [3,7]
20+
<strong>Output:</strong> 12
21+
</pre>
22+
23+
<p>&nbsp;</p>
24+
<p><strong>Constraints:</strong></p>
25+
26+
<ul>
27+
<li><code>2 &lt;= nums.length &lt;= 500</code></li>
28+
<li><code>1 &lt;= nums[i] &lt;= 10^3</code></li>
29+
</ul>
30+
</div>

0 commit comments

Comments
 (0)