Skip to content

Commit 6290394

Browse files
author
sangbeenmoon
committed
solved two-sum.
1 parent c96a6e9 commit 6290394

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

two-sum/sangbeenmoon.py

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

0 commit comments

Comments
 (0)