Skip to content

Commit 9175122

Browse files
committed
Time: 1796 ms (14%), Space: 18.3 MB (87.05%) - LeetHub
1 parent 61085d8 commit 9175122

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

0001-two-sum/0001-two-sum.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Solution:
2+
def twoSum(self, nums: List[int], target: int) -> List[int]:
3+
4+
target1, target2 = None, None
5+
for i in range(len(nums)):
6+
for j in range(i+1, len(nums)):
7+
8+
if nums[i] + nums[j] == target:
9+
return [i,j]
10+
11+
12+
13+
14+
15+
16+
#0 1 2 3 4
17+
18+

0 commit comments

Comments
 (0)