first attempt, solves 12/78

This commit is contained in:
Jacob Delgado 2023-09-04 21:36:51 -07:00
parent a3de7c9d08
commit d257ab3564

View File

@ -0,0 +1,17 @@
def threeSum(nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
# Always end at net zero from the sum
first = 0
second = 1
solutionSets = []
for i in range(len(nums)):
if nums[first] + nums[second] + nums[i] == 0:
solutionSets.append([nums[first], nums[second], nums[i]])
print(threeSum([-1,0,1,2,-1,-4]))