interview-preparation / what-we-do

0 stars 8 forks source link

[Hard] interview questions #19 #172

Open rygh4775 opened 4 years ago

rygh4775 commented 4 years ago

Missing Two: You are given an array with all the numbers from 1 to N appearing exactly once, except for one number that is missing. How can you find the missing number in 0 (N) time and O( 1) space? What if there were two numbers missing?