#####solution01##### # def twoSum(nums, target): # res=[] # for i in range(0,len(nums)-1): # p1 = nums[i] # for j in range(i+1,len(nums)): # if nums[j]==target-p1: # res.append(i) # res.append(j) # return res # continue # ####solution02###### def two…