Answered by a Quora user, Obinna Okechukwu:
You can obviously take the sum of all numbers and compare to 5050, but I’ll do things a little differently if I was given the challenge.
Here’s the strategy I’ll follow:
I’ll start with a count of 0. If you call out an even number, I’ll add that number to the count and if you call out an odd number, I’ll subtract the number from the count.
The nice property of this approach is that the count will ‘on average’ be small enough to fit in my head at any given instant.
Now, to get the actual number which was missing, I’ll compare the final count to 50. If it is X more than 50, then the odd number X was missing. If it is Y less than 50 then the even number Y was missing.