Код: Выделить всё
class Solution:
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for i in nums:
j=target-i
if ((j in nums)==True and (nums.index(j) != nums.index(i))):
return [nums.index(i), nums.index(j)]
Я не уверен, в чем проблема.
Мобильная версия