Created
December 23, 2019 03:18
-
-
Save y16ra/3c48c607a4caf22d34a1d674f4cf5002 to your computer and use it in GitHub Desktop.
Awful python code for Two Sum problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def twoSum(self, nums: List[int], target: int) -> List[int]: | |
for i1, num1 in enumerate(nums): | |
for i2, num2 in enumerate(nums[i1+1:]): | |
if target == (num1 + num2): | |
return [i1, i2 + i1 + 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment