BrainTeaser Basic

Problem - 4653

$\textbf{Missing Number}$

An $99$-element array contains all but one integer between $1$ and $100$. Find the missing number.


$\textbf{Solution}$

There are many different ways to solve this problem. One way is to sum these $99$ integers and then subtract it from $5050$, the result is the missing number. Note that $5050$ is the sum of all the integers from $1$ to $100$.

$\textbf{Note}$

This is a programming problem. However, finding a good solution does not necessarily require specific programming knowledge. On the contrary, many programmers may lean towards more sophisticated programming specific algorithms to solve this problem, which is an over-kill.

report an error