Let's say we have an Integer array with values from 1 to 1000000. Suppose a single number is replaced with '-1'. What is the quickest way to find the number that is replaced? Is there a better way apart from the normal looping/searching linearly?
Please note the size of the array can be anything, the above is just an example to consider data of large size. Consider the array size as "N" containing the values from 1 to N.