How do you find the missing number in a given integer array of 1-100 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

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

Arrays

4th Dec 2018, 7:55 AM
Telaviv
Telaviv - avatar
3 Answers
+ 3
If you sort the array, you can count from 1 and the missing value is found, when the count does not match the current array element.
6th Dec 2018, 5:35 PM
John Wells
John Wells - avatar
6th Dec 2018, 8:56 PM
bedawang
bedawang - avatar