Skip to content

Commit 7641311

Browse files
authored
Add problem
1 parent c6726fa commit 7641311

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
1-
# Two-Sum
1+
# Two Sum
2+
3+
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
4+
5+
You may assume that each input would have exactly one solution, and you may not use the same element twice.
6+
7+
You can return the answer in any order.
8+
9+
### Example:
10+
11+
**_Input:_** `nums = [2,7,11,15], target = 9`
12+
13+
**_Output:_** `[0,1]`
14+
15+
Because `nums[0] + nums[1] == 9`, we return `[0, 1]`.
16+
17+
### Constraints:
18+
19+
`2 <= nums.length <= 10^4`
20+
21+
`-10^9 <= nums[i] <= 10^9`
22+
23+
`-10^9 <= target <= 10^9`
24+
25+
**Only one valid answer exists.**
26+

0 commit comments

Comments
 (0)