8000 added question · dotmarn/algorithm-solution@1b1580d · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b1580d

Browse files
committed
added question
1 parent b966aa2 commit 1b1580d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Two Sum/question.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
2+
3+
You may assume that each input would have exactly one solution, and you may not use the same element twice.
4+
5+
You can return the answer in any order.
6+
7+
### Example 1
8+
```
9+
Input: nums = [2,7,11,15], target = 9
10+
Output: [0,1]
11+
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
12+
```
13+
### Example 2
14+
```
15+
Input: nums = [3,2,4], target = 6
16+
Output: [1,2]
17+
```
18+
### Example 3
19+
```
20+
Input: nums = [3,3], target = 6
21+
Output: [0,1]
22+
```

0 commit comments

Comments
 (0)
0