From dac0c2e7ade77b5fe7213ca971cf277d9b217570 Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:37:15 -0400 Subject: [PATCH] Time: 4055 ms (22.64%), Space: 14.2 MB (68.06%) - LeetHub --- 1-two-sum/1-two-sum.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 1-two-sum/1-two-sum.py 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