A set of unique integers 1..N are randomly placed in an array of length N-2. Determine which two integers are missing.
Try and come up with multiple solutions improving upon space/time complexity. You should be able to do this with constant space and a single pass. Can you solve it for N-3? 4?
this is a slightly modified version of a question asked in a Google interview
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment