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.
I think it would be very helpful if you first polished this code with the following:
Closing the question, it seems you finally solved it.
Again, the problem is in your if condition, not with negative numbers.
I don't really know the best ways for C++, but with the given C++ template you can do something simple, like:
Don't print stuff in tests suite, print it in your function. For C++ you should know about
std::cout
.Well, now you see your code isn't right, so fix it. I've already told you where to look.
And with this one?
Don't just make up inputs, test with them, and call it a day. Check the actual inputs, and test these in your VS.
No idea, are you testing it there with the same input values that are used here?
Your if condition seems to be true for all the elements of the serie.
Not a kata issue, please use
Question
label when the problem is in your code:Read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#how-do-i-post-to-a-kata-discourse
Your if condition is wrong.
The tests are ok, with different items it means you can't use the same number (for instance the same 2 that is in the position 0) as your code does. Your code is returning
{0, 0}
.It's not returning only {0,0} there is a test (the last sample test) that your code fails, and that's because your loops are wrong.
Check this too: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution
For problems with your code use
Question
notIssue
label.