diff --git a/leetcode/1.py b/leetcode/1.py index f05e669..f3865de 100644 --- a/leetcode/1.py +++ b/leetcode/1.py @@ -13,9 +13,11 @@ class Solution: if nums[i] == another: temp_list = nums temp_list.pop(i) - if another not in temp_list: + if another in temp_list: answer.append(i) answer.append(temp_list.index(another) + 1) + elif another not in temp_list: + continue answer.append(i) answer.append(nums.index(another)) return answer