Thursday, December 22, 2005

Missing Integers Part 1

A simple one today.

A set of unique integers 1..N are randomly placed in an array of length N-1. Determine which integer is 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.

No comments: