diff --git a/NeetCodeRoadmap/Arrays_and_Hashing/15_3Sum.py b/NeetCodeRoadmap/Arrays_and_Hashing/15_3Sum.py index e69de29..641b851 100644 --- a/NeetCodeRoadmap/Arrays_and_Hashing/15_3Sum.py +++ b/NeetCodeRoadmap/Arrays_and_Hashing/15_3Sum.py @@ -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])) \ No newline at end of file