Re:Want a job working on mongoDB? Your first online intervie...
by rglullis on Saturday April 23, 2011 @03:48PM
(#2477394)
Since you didn't put SPOILER ALERT, I guess it's okay to say that I was going for a similar approach, except that I was going to use sum of elements and the XOR of all elements. I guess the only advantage is that computing the XOR should be faster/smaller space than summing squares.
[ Parent
| on HN ]
Re:Want a job working on mongoDB? Your first online intervie...
by esrauch on Saturday April 23, 2011 @04:02PM
(#2477452)
Your solution won't work because you can't solve for a and b if you are given (a xor b) and (a - b), consider an extra 3 and missing 2 will give 1 for both values, as will extra 5 and missing 4.