Demo entry 6623425

1-solution

   

Submitted by anonymous on Jun 08, 2017 at 04:00
Language: Python. Code size: 246 Bytes.

class Solution(object):
    def twoSum(self, nums, target):
        dict = {}
        for i in xrange(len(num)):
            x = num[i]
            if target-x in dict:
                return (dict[target-x]+1, i+1)
            dict[x] = i

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).