Ok, the challenge is kind of easy, right?
The problem is not adding. The problem is that the numbers are not in order. Create a function that organizes the numbers and adds the numbers in the range between X and Y.
Here is an example:
X = -10 | Y=1
So this will be the range of numbers:
-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1
This will be your result:
-54
Remember, X and Y are disorganized, so to get to the result you know what you have to do.
justAnotherSumProblem(-10, 1) β -54
justAnotherSumProblem(-20, 5) β -195
justAnotherSumProblem(90, 45) β 3105