Time: 4055 ms (22.64%), Space: 14.2 MB (68.06%) - LeetHub

This commit is contained in:
Deven
2022-07-11 23:37:15 -04:00
parent 05e67010b5
commit dac0c2e7ad
+12
View File
@@ -0,0 +1,12 @@
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
length = len(nums)
for i in range(length):
for j in range(i + 1, length):
if nums[i] + nums[j] == target:
return [i, j]