Posted by: neurologist December 12, 2014
Login in to Rate this Post:
0
?
if the numbers are in sequence, this function works fine. if its not in sequence its different story.
m = missing number
x = 1;
for i = 1 to million
{
if x is not equal to i
{
m = x = missing number;
stop iteration;}
x = x + 1;
}
output m;
m = missing number
x = 1;
for i = 1 to million
{
if x is not equal to i
{
m = x = missing number;
stop iteration;}
x = x + 1;
}
output m;