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