Missing number | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 18

Missing number

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

6th Sep 2018, 11:06 PM
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬ - avatar
7 Respostas
+ 10
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.
7th Sep 2018, 8:38 AM
Md. Nafis Ul Haque Shifat
Md. Nafis Ul Haque Shifat - avatar
+ 18
Another method of finding the missing number of an array of 1-100 https://code.sololearn.com/cIidenkA3xHs/?ref=app
7th Sep 2018, 11:48 AM
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬ - avatar
+ 15
Copy....Thanks Tind
6th Sep 2018, 11:59 PM
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬ - avatar
+ 14
That was perfect NimWing Yuan....Thanks a lot
7th Sep 2018, 2:27 AM
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬
//Fpharbhulourz/>šŸ˜‹šŸ˜ˆšŸ¤“šŸ‡³šŸ‡¬ - avatar
+ 6
Fpharbhulourz Solution : šŸ’— šŸ¤—šŸ™†ā€ā™‚ļø https://code.sololearn.com/cGvqJdYNVTp7/?ref=app
7th Sep 2018, 2:25 AM
NimWing Yuan
NimWing Yuan - avatar
+ 5
Fpharbhulourz : You are wellcome šŸ’— šŸ™†ā€ā™‚ļøšŸ¤—
7th Sep 2018, 2:31 AM
NimWing Yuan
NimWing Yuan - avatar
+ 2
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
7th Sep 2018, 2:51 AM
Mohamed Azarudin
Mohamed Azarudin - avatar