Created
October 18, 2016 22:01
-
-
Save plumps/b6e5ad7a2c122a2d4b3b9fa81697ddea to your computer and use it in GitHub Desktop.
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(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