Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Suppose the given list of numbers doesn't contain any positive numbers.
There is nothing to sum up, but a return value still needs to be specified.
The mathematical sum operator
$\sum$
is defined to result in 0 if there is nothing to sum up, but not everyone knows that. Some definitions of a sum even have the sum of nothing be undefined.I was really confused by the return 0. I was trying to work my code, that it would end with return zero. I realized by trying that it needs to be ignored. But why is it there in the first place?
So do I understand it correctly, that we also need to provide x, the list of names?