Given an continuous integer array, if there is one number missing, how to find it out without sorting? How about two numbers?
Sigiloso
(max-min)+1 method can only find out the "number" of missing integers, but the particular number value is still unknown. The answer should be: find max and min, assume there is no number missing, get the Sum of the array, then use the Sum of the given array to subtract it. The difference is the missing one. For the case of two missing numbers, build two equations with two variables. one equation comes from the Sum difference, another from product difference