From 023c1e422dcfae87851cd810391f64da9c3d36f8 Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Mon, 11 Jul 2022 23:32:33 -0400 Subject: [PATCH] Time: 2860 ms (34.24%), Space: 14.4 MB (22.20%) - 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