Skip to content

Commit 2459408

Browse files
committed
Create README - LeetHub
1 parent f8890c0 commit 2459408

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

0001-two-sum/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<h2><a href="https://leetcode.com/problems/two-sum/">1. Two Sum</a></h2><h3>Easy</h3><hr><div><p>Given an array of integers <code>nums</code>&nbsp;and an integer <code>target</code>, return <em>indices of the two numbers such that they add up to <code>target</code></em>.</p>
2+
3+
<p>You may assume that each input would have <strong><em>exactly</em> one solution</strong>, and you may not use the <em>same</em> element twice.</p>
4+
5+
<p>You can return the answer in any order.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre><strong>Input:</strong> nums = [2,7,11,15], target = 9
11+
<strong>Output:</strong> [0,1]
12+
<strong>Explanation:</strong> Because nums[0] + nums[1] == 9, we return [0, 1].
13+
</pre>
14+
15+
<p><strong class="example">Example 2:</strong></p>
16+
17+
<pre><strong>Input:</strong> nums = [3,2,4], target = 6
18+
<strong>Output:</strong> [1,2]
19+
</pre>
20+
21+
<p><strong class="example">Example 3:</strong></p>
22+
23+
<pre><strong>Input:</strong> nums = [3,3], target = 6
24+
<strong>Output:</strong> [0,1]
25+
</pre>
26+
27+
<p>&nbsp;</p>
28+
<p><strong>Constraints:</strong></p>
29+
30+
<ul>
31+
<li><code>2 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
32+
<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
33+
<li><code>-10<sup>9</sup> &lt;= target &lt;= 10<sup>9</sup></code></li>
34+
<li><strong>Only one valid answer exists.</strong></li>
35+
</ul>
36+
37+
<p>&nbsp;</p>
38+
<strong>Follow-up:&nbsp;</strong>Can you come up with an algorithm that is less than&nbsp;<code>O(n<sup>2</sup>)&nbsp;</code>time complexity?</div>

0 commit comments

Comments
 (0)