From 2733df984ae528685323dbf4e309bde8e57aa9d7 Mon Sep 17 00:00:00 2001 From: Deven <63876261+devenperez@users.noreply.github.com> Date: Tue, 12 Jul 2022 12:57:43 -0400 Subject: [PATCH] Time: 3706 ms (26.43%), Space: 14.3 MB (44.44%) - LeetHub --- 1-two-sum/1-two-sum.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/1-two-sum/1-two-sum.py b/1-two-sum/1-two-sum.py index def56b1..3e543b6 100644 --- a/1-two-sum/1-two-sum.py +++ b/1-two-sum/1-two-sum.py @@ -5,8 +5,7 @@ class Solution(object): :type target: int :rtype: List[int] """ - length = len(nums) - for i in range(length): - for j in range(i + 1, length): + 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