NVIDIA interview question

if there exists a sequence of integers in order, and you are at a receiver and you obtain these integers out of order, how can you know which integer is missing?

Interview Answer

Anonymous

17 Jul 2013

I said receive the numbers in a linked list so when they are done they are sorted and then we can tell which one is missing. The answer the interviewer was looking for was simply add them and subtract them from the expect value (which assumed we know the base but this wasnt clarified).