Answers for "How do you find the missing number in a given integer array of 1 to 100? Mar 22 2021 1"

1

How do you find the missing number in a given integer array of 1 to 100?

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!!!! :)
Posted by: Guest on March-23-2021

Code answers related to "How do you find the missing number in a given integer array of 1 to 100? Mar 22 2021 1"

Python Answers by Framework

Browse Popular Code Answers by Language