why isn't there any indication on what to do if begin > end and the step is negative ?
according to the explanation of the kata the result should be 0, but it's clearly not, and it seems that something else should occur in that case and I don't seem to be able to find in the explanation of the kata
If it is an impossible sequence (with the beginning being larger the end and a positive step or the other way around), just return 0.
The above statement means that for
begin > end && step > 0 || begin < end && step < 0
, it shouldreturn 0
. So, it is perfectly clear.why isn't there any indication on what to do if begin > end and the step is negative ?
according to the explanation of the kata the result should be 0, but it's clearly not, and it seems that something else should occur in that case and I don't seem to be able to find in the explanation of the kata