diff --git a/1-two-sum/1-two-sum.py b/1-two-sum/1-two-sum.py new file mode 100644 index 0000000..def56b1 --- /dev/null +++ b/1-two-sum/1-two-sum.py @@ -0,0 +1,12 @@ +class Solution(object): + def twoSum(self, nums, target): + """ + :type nums: List[int] + :type target: int + :rtype: List[int] + """ + length = len(nums) + for i in range(length): + for j in range(i + 1, length): + if nums[i] + nums[j] == target: + return [i, j] \ No newline at end of file