Skip to content

Commit 40a89f0

Browse files
authored
Update Solution.py
it is easy concept i think
1 parent 482bbf4 commit 40a89f0

File tree

1 file changed

+4
-5
lines changed

1 file changed

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

0 commit comments

Comments
 (0)