This commit is contained in:
sangge-rockpi 2024-01-19 20:37:48 +08:00
parent 0629a672af
commit ee9d079d0b

View File

@ -13,9 +13,11 @@ class Solution:
if nums[i] == another: if nums[i] == another:
temp_list = nums temp_list = nums
temp_list.pop(i) temp_list.pop(i)
if another not in temp_list: if another in temp_list:
answer.append(i) answer.append(i)
answer.append(temp_list.index(another) + 1) answer.append(temp_list.index(another) + 1)
elif another not in temp_list:
continue
answer.append(i) answer.append(i)
answer.append(nums.index(another)) answer.append(nums.index(another))
return answer return answer