Skip to content

Commit 106d6de

Browse files
committed
two sum solution
1 parent b7c1554 commit 106d6de

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

two-sum/mrlee7.py

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

0 commit comments

Comments
 (0)