Skip to content

Instantly share code, notes, and snippets.

@plumps
Created October 18, 2016 22:01
Show Gist options
  • Save plumps/b6e5ad7a2c122a2d4b3b9fa81697ddea to your computer and use it in GitHub Desktop.
Save plumps/b6e5ad7a2c122a2d4b3b9fa81697ddea to your computer and use it in GitHub Desktop.
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for cx, x in enumerate(nums):
for cy, y in enumerate(nums):
if x + y == target and cx != cy:
return [cx, cy]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment