From a357e56753338076b40a1dcd9e9e41b04661e6bd Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Tue, 12 Jul 2022 00:18:39 -0400 Subject: [PATCH] Time: 4575 ms (17.88%), Space: 14.3 MB (68.06%) - LeetHub --- 1-two-sum/1-two-sum.py | 11 +++++++++++ 1 file changed, 11 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..3e543b6 --- /dev/null +++ b/1-two-sum/1-two-sum.py @@ -0,0 +1,11 @@ +class Solution(object): + def twoSum(self, nums, target): + """ + :type nums: List[int] + :type target: int + :rtype: List[int] + """ + for i in range(len(nums)): + for j in range(i + 1, len(nums)): + if nums[i] + nums[j] == target: + return [i, j] \ No newline at end of file