📌  相关文章
📜  如何在给定的 1 到 100 整数数组中找到缺失的数字? - Python 代码示例

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

代码示例1
def getMissingNo(A):
    n = len(A)
    total = (n + 1)*(n + 2)/2
    sum_of_A = sum(A)
    return total - sum_of_A
 
A = [1, 2, 4, 5, 6]
miss = getMissingNo(A)
print(miss)

## Good luck with your Interview!!!! :)