Given a list of N integers check if their sum is the same as the sum of first N natural numbers.
The required stamp division is possible if:
C1 + … + CN = 1 + 2 + … + N
There’s a very common formula for the sum of first N natural numbers that is:
1 + 2 + … + N = N(N+1)/2*. (Proof)
So just compute the sum of all the numbers and check if the sum is N*(N+1)/2. Be careful of overflow, use 64 bit integers for computing the sum.