It is not possible to save the summation of the first N positive integers if N is very close to 64-bit. Thus, we can use a datatype that is larger than 64-bit. We can also observe that the answer is Yes only if N is odd (why?) and implement from that easily.

Contributors

Statistics

84% Solution Ratio
dream_playerEarliest, Feb '21
Sporsha.117765Fastest, 0.0s
ashraful9194Lightest, 0 B
ShuddhoShortest, 30B
Toph uses cookies. By continuing you agree to our Cookie Policy.