第一题:

python leetcode

答案:

def two_sum(list,target):
    d = {}
    for i in list:
        for j in list:
            if (i!=j ) &(i+j == target) :
                d[i] = j
    return d

a = [1,2,3,4,5,6]
b = 5
print (two_sum(a,b))

第二题:

python leetcode

答案:

python leetcode

第三题:

python leetcode

答案:

python leetcode

相关文章:

  • 2021-09-01
  • 2021-11-29
  • 2021-07-04
  • 2021-07-29
  • 2022-01-01
  • 2021-08-28
  • 2021-07-27
  • 2021-09-29
猜你喜欢
  • 2021-12-04
  • 2021-08-11
  • 2021-06-16
  • 2022-02-26
  • 2021-11-06
  • 2022-01-13
  • 2021-05-21
相关资源
相似解决方案