Interviews2 answers
Find the missing number?

Shantanu Patel
Posted Sep 13, 2013, 5:52 AM EDT2 Answers
I think we can do:
Sum of numbers between 1 to 100 = 5050
Run a foreach loop adding all the values in the array.
At the end, subtract it from 5050 and you will get the missing value.
Aman JainPosted Oct 23, 2013, 12:21 AM EDT
Suppose you have an array of index 0-98. Random function inserts number between 1-100 in the array.
None of the number would be inserted twice(i.e. unique number would get inserted)
What all are the ways by which you can find the missing number not in array.
Shantanu PatelPosted Sep 13, 2013, 5:52 AM EDT
