Skip to content

Commit c45fbfa

Browse files
committed
Day 8
Two Sum from array
1 parent 7550687 commit c45fbfa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

day_8_two_sum.py

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

0 commit comments

Comments
 (0)