📌  相关文章
📜  在 Python 代码示例中的数组中查找缺失的数字

📅  最后修改于: 2022-03-11 14:46:33.725000             🧑  作者: Mango

代码示例1
def get_missing_summatin(a):
  n = a[-1]
  total = n*(n+1)//2
  summation = 0
  summation = sum(a)
  result = total-summation
  print(result)

a = [1,2,3,5,6,7]
get_missing_summatin(a)