Skip to content

Commit 1d0a568

Browse files
shauryaa108mao-sz
andauthored
09_sumAll : Clarify negative input handling (#653)
Co-authored-by: mao-sz <122839503+mao-sz@users.noreply.github.com>
1 parent 5c797c3 commit 1d0a568

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

foundations/09_sumAll/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Implement a function that takes 2 positive integers and returns the sum of every
66
sumAll(1, 4) // returns the sum of 1 + 2 + 3 + 4 which is 10
77
```
88

9+
If the function receives invalid arguments (such as negative numbers, non-integers, strings etc. - anything other than positive integers), it should return the string `'ERROR'`.
10+
911
## Hints
1012

1113
- How will you ensure you're summing all integers within the correct range, no matter the order of the inputs?
12-
- Think about your sum's starting value. Then, how can you make sure every single number from the smaller input to the larger one (including both) gets added to it?
14+
- Think about your sum's starting value. Then, how can you make sure every single number from the smaller input to the larger one (including both) gets added to it?

0 commit comments

Comments
 (0)