8000 Create [Leet Code] 1. Two Sum jamin.py #108 · jaminleee/algorithm-study@7a9e60d · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a9e60d

Browse files
committed
Create [Leet Code] 1. Two Sum jamin.py da-in#108
1 parent 99af465 commit 7a9e60d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Leet Code/Two Sum/jamin.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def twoSum(self, nums: List[int], target: int) -> List[int]:
3+
find = {}
4+
for i in range (len(nums)): #0,1,2...
5+
for j in range (i+1,len(nums)):
6+
if nums[i]+nums[j] == target:
7+
return [i,j]
8+
9+
10+

0 commit comments

Comments
 (0)
0