Missing number | Sololearn: Learn to code for FREE!


Missing number

How do you find the missing number of an integer array of 1-100?

7 Answers

New Answer


let, s is the sum of the array you have. then, the missing will be: 5050-s let me explain.... the sum of the numbers from 1 to 100 will be.. ((1+100)*100)/2=5050.. Now if s is the sum of the numbers you have, you can simply find the missing number by substracting s from 5050.


Another method of finding the missing number of an array of 1-100 https://code.sololearn.com/cIidenkA3xHs/?ref=app



That was perfect NimWing Yuan....Thanks a lot


Fpharbhulourz Solution : 💗 🤗🙆‍♂️ https://code.sololearn.com/cGvqJdYNVTp7/?ref=app


Fpharbhulourz : You are wellcome 💗 🙆‍♂️🤗


Here you can find the code to find multiple missing numbers in an array Modified code of NimWing Yuan Thanks https://code.sololearn.com/cIuh1i1QiSS9/?ref=app