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.
This comment is hidden because it contains spoiler information about the solution
I would not bet on modifcation of input, because in the default setup, the input vector is passed by value what causes that modifications would not be visible to the caller (i.e. tests), unless user changed signature of the function and made it accept the vector by non-const reference.
Anyway, sharing your code here (remember about code formatting and spoiler flag) would allow us to see what's wrong and fix potential issues with the kata.
Maybe I have not been clear, so I'll try to reword it: the problem is probably that you modify the input, while you should not do that. For this reason, I suspect the tests expect a wrong result. However, as I told you, the tests normally never expect a negative value. This kata has been solved nearly a 1000 times in C++ and such an issue has never been reported, so you must do something badly. If you want further help you can post your code with a spoiler flag.
the
"Expected: equal to -652
Actual: 978"
is an error that the test is giving me, its not calculated by me...
my output is 978 while the random tests tell me that the output should be -652
.
You must modify the input. Please check it. I've just tried again my solution, it works nicely and cannot return a negative value since it returns an unsigned.
C++ kata is having major issues:
i do not think that it should be even possible to get negative lengths from intervals