I thought the trick with this one was to sum all the entries and subtract the sum of 0 to N-2. The remainder is the duplicate entry.
It's just a trick though; I don't think skill in coming up with these is particularly well-correlated with being a good programmer, and for that reason Google claims not to do teasers like this any more.