**Hadi & Math**↵
↵
What is the Sum of the numbers from 1 ... n↵
↵
<spoiler summary="hint">↵
excepted_sum = n*(n+1)/2↵
</spoiler>↵
↵
Knowing the actual sum and the excepted sum, how to find the missing sum?↵
↵
<spoiler summary="solution">↵
answer = n*(n+1)/2 — sum(Array)↵
</spoiler>↵
↵
<spoiler summary="tip">↵
For c++ users use long long, and for java users long to avoid overflow↵
</spoiler>↵
↵
↵
↵
What is the Sum of the numbers from 1 ... n↵
↵
<spoiler summary="hint">↵
excepted_sum = n*(n+1)/2↵
</spoiler>↵
↵
Knowing the actual sum and the excepted sum, how to find the missing sum?↵
↵
<spoiler summary="solution">↵
answer = n*(n+1)/2 — sum(Array)↵
</spoiler>↵
↵
<spoiler summary="tip">↵
For c++ users use long long, and for java users long to avoid overflow↵
</spoiler>↵
↵
↵